Summary: | Feature request: adapt lib/zugferd.ps to newer versions of the ZUGFeRD standard | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Adrian Devries <adrian.devries> |
Component: | PDF Writer | Assignee: | Ken Sharp <ken.sharp> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | orettig |
Priority: | P4 | ||
Version: | 9.54.0 | ||
Hardware: | PC | ||
OS: | Windows 10 | ||
Customer: | Word Size: | --- | |
Attachments: | Enhanced version of lib/zugferd.ps |
Description
Adrian Devries
2021-05-19 04:54:49 UTC
Hi Adrian, Firstly let me say thanks for the submission, much appreciated! (In reply to Adrian Devries from comment #0) > The ZUGFeRD standard has grown over time (cf. > https://www.ferd-net.de/standards/zugferd-versionsarchiv/index.html), the > newest version is 2.1.1. Obviously our focus is printing so we aren't tracking the ZUGFeRD/Factur-X standard. I'm afraid I have no way to know when a new/updated standard is released. > The current script "lib/zugferd.ps" is based on a > pre-release version of the standard, and there is a bug in that script (cf. > https://bugs.ghostscript.com/show_bug.cgi?id=703861). > Find attached an > enhanced version of the script supporting all known versions of the ZUGFeRD > standard. Remaining tasks have been marked with "TODO". Rather than fix the existing program I'd prefer to adopt your work, but I think I need a Contributor License Agreement because it is a significant enough change that we need copyright assignment. Its much more than a trivial update to the original program. Could I ask you to fill out this PDF https://www.ghostscript.com/images/Artifex%20Contributor%20License%20Agreement%202017.pdf please ? Artifex needs copyright assignment or we can't distribute the code on a commercial basis. We will, of course, be making it available open-source as well. Once I have that I will push the improved program to our Git repository. You will be recorded as the author of the commit, so can I ask how you would like to be identified ? Hi Ken, I sent a signed copy of the Contributor License Agreement to you by facsimile and by e-mail. Please, take the name of my bugzilla account to identify me. Thanks in advance! (In reply to Adrian Devries from comment #2) > Hi Ken, > > I sent a signed copy of the Contributor License Agreement to you by > facsimile and by e-mail. Please, take the name of my bugzilla account to > identify me. Absolutely brilliant, many thanks for that, and for doing all the work. As soon as I hear back from the office I will get it committed. Just in time for the next release too! Leaving this open until I actually make the commit so I don't forget. Hi Ken, please, note that there is another issue that exists still in the enhanced version of lib/zugferd.ps. Line 177 of the original file (line 442 of the enhanced file) contains the following. "/ModDate (D:20130121081433+01’00’)", i.e., hours and minutes are followed by char 0x92 instead of char 0x27. The text should be written as follows: "/ModDate (D:20130121081433+01'00')". (In reply to Adrian Devries from comment #4) > Hi Ken, > > please, note that there is another issue that exists still in the enhanced > version of lib/zugferd.ps. Line 177 of the original file (line 442 of the > enhanced file) contains the following. "/ModDate > (D:20130121081433+01’00’)", i.e., hours and minutes are followed by char > 0x92 instead of char 0x27. The text should be written as follows: "/ModDate > (D:20130121081433+01'00')". Hmm nobody has ever mentioned that before! That'll be in pdfwrite itself, I'll go and look, thanks. (In reply to Adrian Devries from comment #4) > Hi Ken, > > please, note that there is another issue that exists still in the enhanced > version of lib/zugferd.ps. Line 177 of the original file (line 442 of the > enhanced file) contains the following. "/ModDate > (D:20130121081433+01’00’)", i.e., hours and minutes are followed by char > 0x92 instead of char 0x27. The text should be written as follows: "/ModDate > (D:20130121081433+01'00')". D'oh, I can't read, its the zugferd.ps file. Right, I will fix that before I commit. I suspect an overly helpful editor.... Update committed here: https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=0a6b6cfaa7740cbef31644afbd0085b0eca38c43 Thanks very much for the contribution! I'm just writing an email to a colleague to update the relevant page on our website, but that won't be done before Monday. For those who want to leverage the ZUGFeRD Ghostscript feature with the German IT company DATEV providing services to tax consultants: Whereas the generated PDF actually validates correctly according to the 2.1.1 standard, DATEV is not able to recognize the attached XML. This is due to the File Specification Dictionary that is defined as /Type /FileSpec whereas the standard is asking for /Type /Filespec DATEV is picky on this (and perhaps others as well). If you change the lib/zugferd.ps accordingly, all information is interpreted appropriately. BTW, in the meantime version 2.2 of the standard got released. But as long as this is not made mandatory, 2.1.1 is perfectly fine. I highly appreciate all the efforts you had put into this! It does provide great help with introducing electronic invoices with established business processes. Thanks so much! (In reply to Oliver Rettig from comment #8) > /Type /FileSpec > > whereas the standard is asking for > > /Type /Filespec The PDF 1.7 spec says (Section 3.10.2, File Specification Dictionaries) that it should indeed have a Type of Filespec (the PDF specification has no consistency in use of camel case sadly). I've pushed this commit d1a0339f45c355aa04b3168de3a8d7a4e6d63e34 to fix that. Thanks for reporting it! |