Reputation: 1491
I am trying to convert a PDF file to comply with PDF/A-3 format and attach an XML file to it as well so it complies with ZUGFeRD standard. I am using a program from Ghostscript zugferd.ps
but it keeps throwing this error.
Unrecoverable error: rangecheck in .putdeviceprops
I am following this official guide from Ghostscript.
This is the GS command that I am running:
gs --permit-file-read=/Users/myname/Documents/einvoicing/ -sPDFACompatibilityPolicy=1 \
-sDEVICE=pdfwrite -dPDFA=3 -sColorConversionStrategy=RGB \
-sZUGFeRDXMLFile=/Users/myname/Documents/einvoicing/invoice.xml \
-sZUGFeRDProfile=/Users/myname/Documents/einvoicing/AdobeRGB1998.icc \
-sZUGFeRDVersion=2p1 -sZUGFeRDConformanceLevel=BASIC \
-o /Users/myname/Documents/einvoicing/zugferd.pdf \
/Users/myname/Documents/einvoicing/zugferd.ps /Users/myname/Documents/einvoicing/simple_pdf.pdf
Note that I am not running it with backslashes("\"), it is just here for readability.
Also it's good to note that I have AdobeRGB199.icc
, and zugferd.ps
in this directory.
I also tried without -sPDFACompatibilityPolicy=1
flag and then it succeeds, but when I run it through Vera validator, it is invalid.
Let me know if you need any more info.
Upvotes: 0
Views: 318
Reputation: 11739
There seems to be a problem with latest GS 10.04.0 and ZUGFeRD attachment that was not there in prior 10.03.#.
[Later edit] this is a reported problem with correctly embedded XML but may have doubled /AF entries see https://bugs.ghostscript.com/show_bug.cgi?id=708066 and at bottom of this answer a link to, a for now updated, zugferd.ps.
An additional control for PostScript has been added and the supposed over-ride is stated as gs --permit-devices=* --permit-file-read=... ...
, but that does not add the XML in the same way the prior command worked.
For Windows users a fuller working example could be.
(For 10.03.1 remove that initial --permit devices=*)!
gs[win##c].exe --permit-devices=* ^
--permit-file-read=C:/Users/myname/Documents/einvoicing/ ^
-sDEVICE=pdfwrite -dPDFA=3 -dPDFACompatibilityPolicy=2 ^
-sColorConversionStrategy=RGB ^
-sZUGFeRDXMLFile=C:/Users/myname/Documents/einvoicing/invoice.xml ^
-sZUGFeRDProfile=C:/Users/myname/Documents/einvoicing/srgb.icc ^
-o C:/Users/myname/Documents/einvoicing/zugferd.pdf ^
C:/Users/myname/Documents/einvoicing/zugferd.ps ^
C:/Users/myname/Documents/einvoicing/simple_pdf.pdf
This will currently in 10.03.# produce
For 10.04.0 users download this replacement zugferd.ps file and follow the normal internal instructions at line 134 https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/plain/lib/zugferd.ps?id=5d9b000c70f66f5be7bfaed1f16ef4e50d820dc6
Upvotes: 1