Reputation: 53
first of all I read the documentation here Creating a ZUGFeRD pdf to have a Zugferd PDF/A-3 pdf compliant :
gs -dBATCH -dNOSAFER --permit-file-read=${PWD} -sDEVICE=pdfwrite -dPDFA=3 -sColorConversionStrategy=RGB -sPDFACompatibilityPolicy=1 -sZUGFeRDXMLFile=${PWD}/factur-x.xml -sOutputICCProfile=${PWD}/sRGB.icc -sOutputFile=${PWD}/RE.__2021_0002_pdf3a.pdf ${PWD}/PDFA_def.ps ${PWD}/RE.__2021_0002.pdf
Then I used facturx library in python to generate RE.__2021_0002_factur-x_embedded.pdf invoice containing factur-x.xml embedded inside then i used this command from ghostscript to convert it to PDF/A-3 compliant gs -dPDFA=3 -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=RE.__2021_0002_factur-x_embedded_pdf3a.pdf RE.__2021_0002_factur-x_embedded.pdf
But unfortunately, the resulting pdf is not PDF/A-3 compliant and it also lost the embedded factur-x.xml after this command.
I checked most of the questions here in StackOverflow regarding this topic, for example here, and tried the commands and read the comments but it didn't work too.
Update: The resulting pdf is not compatible with neither PDF/A-3a nor PDF/A-3b.
I need to know how to properly make the pdf invoice PDF/A-3 compliant?
Thanks.
Upvotes: 1
Views: 1346
Reputation: 53
Before reading my answer please also consider looking at the comments on my question from @KenS . Thanks @KenS for your contribution! I could convert regular pdf to PDF/A-3b using the command and it worked:
gs -dPDFA=3 -dBATCH -dNOPAUSE -dNOSAFER -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=3 -sOutputFile=<outputfile> <inputfile>
And i used -dPDFACompatibilityPolicy=3
according to the answer here by @exa
So for me the problem was solved by using the option -sColorConversionStrategy=UseDeviceIndependentColor
Upvotes: 1