How to use ghostscript to convert PDF to PDF/A or PDF/X?

Viewed 80027

Is there a way to use ghostscript to convert PDF to PDF/A or PDF/X? I know it can be used to convert PDF to images, but I don't know if it can be used to convert PDF/A. What parameters should I use?

5 Answers

Please note that current answers are not completely correct. You can define which level of PDF/A you want, resulting in different behaviors of the program. This one is correct:

gs -dPDFA -dBATCH -dNOPAUSE -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=2 -sOutputFile=output_filename.pdf input_filename.pdf

Please note my change from sdPDFACompatibilityPolicy to dPDFACompatibilityPolicy. Change it to a higher number to get other versions. 1 is good if you don't need DOCINFO. Furthermore we use the option UseDeviceIndependentColor to avoid validating issues.

If you change options here, you will most likely get a non compliant PDF/A (even if it stated differently). You can check your pdf/a here: https://www.pdf-online.com/osa/validate.aspx

If you're using Windows and want to create PDF/A-1b documents explicitely (PDFCreator has an output option for PDF/A-2b but not for PDF/A-1b), you just can enter the parameters Artur described above into the ui settings of PDFCreator without the ones for the document names. Start PDFCreator, choose the printer menu, then go to settings. Now, choose 'Ghostscript' from the settings list on the left side. Under 'additional ghostscript settings', enter as follows :

-dPDFA|-dBATCH|-dNOPAUSE|-dUseCIEColor|-sProcessColorModel=DeviceCMYK|-sDEVICE=pdfwrite|-sPDFACompatibilityPolicy=1

Click on 'Save', then print something from MS Word or any other application you want using the PDFCreator - it will be created in PDF/A-1b.

Greetings, Fritz

Related