0

i want to use ghostscript to create an Zugferd invoice The konvertion from PDF into PDF/A3 is successfull but there is no xml attached. i use it with the shell option in ms access, therefore i build a string:

str = "gswin64c " & _
" -dNOSAFER " & _
"    -sDEVICE=pdfwrite " & _
"    -dPDFA=3 " & _
"    -sColorConversionStrategy=RGB " & _
"    -sZUGFeRDXMLFile=C:/users/public/gszugferd/ZUGFeRD-invoice.xml " & _
"    -sZUGFeRDProfile=C:/users/public/gszugferd/srgb.icc     " & _
"    -sZUGFeRDVersion=2p1 " & _
"    -sZUGFeRDConformanceLevel=BASIC " & _
"    -o /users/public/gszugferd/zugausgabe.pdf " & _
"    /users/public/gszugferd/zugferd.ps  " & _
"    /users/public/gszugferd/R4688.pdf "`

The pdf is created, but no xml added. srgb.icc and zugferd.ps is original from the gs lib.

is there any requirement for the xml file to be attached ?

4
  • thanks very much, it works now. i put all in one directory and for windows i had to set the filenames in quotes Commented Dec 1, 2024 at 16:05
  • I am almost positive that the resulting PDF will not validate. The name of the XML should be factur-x.xml, you do not add a PDF/A extension schema to the XMP metadata of the file, the current ZUGFeRD version is "3" (not "2p1"), ... Commented Dec 3, 2024 at 17:12
  • the attached xml file is automaticliy named factur-x.xml. Commented Dec 5, 2024 at 19:23
  • the attached xml file is automaticliy named factur-x.xml. Thanks for the hint of version 3. In my zugferd.ps there is no option for 3. Maybe i have to update my ghostcript version. (Das XML File im Anhang wird als factur-x.xml angehängt, egal wie das Eingabexml heißt. das ist so in zugferd.ps hinterlegt. Version 3 wird da gar nicht abgefragt, die letzte Version in meiner zugferd.ps ist 2p1. Vielleicht muß ich meine Ghostscriptversion aktualisieren) Commented Dec 5, 2024 at 19:24

2 Answers 2

0

There is probably a bug in ghostscript 10.04 with ZugFerd.ps - It took me several hours before i tried it with gs 10.03.0 . I added a Watermark to show in PDF that XML is included. Now it works for me in Windows for ZugFerd Extended:

"C:\Program Files\gs\gs10.03.0\bin\gswin64c.exe" 
--permit-file-read=d:/ 
-dNOSAFER 
-sDEVICE=pdfwrite 
-dPDFA=3 
-sColorConversionStrategy=RGB 
-sZUGFeRDXMLFile="D:\source\factur_x.xml" 
-sZUGFeRDProfile="D:\gsdata\AdobeRGB1998.icc" 
-sZUGFeRDVersion=2p1 
-sZUGFeRDConformanceLevel="EXTENDED" 
-o "D:\zfOut\ZugFerdInvoice.pdf" 
"D:\gsdata\ZugferdWatermark.ps" 
"d:\gsdata\zugferd.ps" 
"D:\source\invoice_source.pdf" 
-c "[ /Title (inv Nr.<inr>) /Author (<author>) /Subject (electronic 
invoice...MD5-Hash: ddf1d350105368f69e897...) /Keywords (<keywords>)  
/DOCINFO pdfmark
Sign up to request clarification or add additional context in comments.

1 Comment

Hello, is it possible to post or show us your zugferd.ps and ZugferdWatermark.ps ? And what is your -c command line? Regards
0

The XML file is usually embed but without a visible name. There are on occasion problems using some source files with /AF (Attached File) named markers in versions 10.04.0. A full install from latest source should clear those.

The previous "known good" ZuGFeRD compatible working releases were supposedly 10.02 or perhaps 10.03 if lucky.

All the latest corrections are scheduled to be in Release 10.05 due about March 2025

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.