i-effect Manual

Create PDF/A compatible PDF with Ghostscript

For the ZUGFeRD conversion, a custom PDF can also be merged with the generated XML file. This PDF must comply with the PDF/A standard.

To create a compatible PDF/A, Ghostscript can be used, which can simply be installed via SSH.

/QOpenSys/pkgs/bin/yum install ghostscript

Furthermore, a color profile is required as an .icc file, which is used during the conversion and embedded in the PDF/A. Any .icc file can be used for this; a suitable source is e.g.: https://github.com/saucecontrol/Compact-ICC-Profiles/blob/master/profiles/AdobeCompat-v2.icc


The installed Ghostscript should be located under "\QOpenSys\pkgs\share\ghostscript\<version>\lib". In this folder there is the file PDFA_def.ps, in which the .icc profile is linked.

In the following example, the .icc profile and PDFA_def.ps were copied into the newly created folder "/home/ieffect/ghostscript/", and the following lines in PDFA_def.ps were adjusted:

% Define an ICC profile :
/ICCProfile (/home/ieffect/data/ghostscript/sRGB-v4.icc) % Customise

In addition, the folders /in and /out were created, and the Ghostscript call was saved in the file ghostscript.sh:

#!/QOpenSys/pkgs/bin/bash
/QOpenSys/pkgs/bin/gs -dPDFA=1 -dBATCH -dNOPAUSE -dNOOUTERSAVE -dDEBUG -dDUMP_STDIN -dNOSAFER \
  -sDEVICE=pdfwrite -sColorConversionStrategy=RGB -sProcessColorModel=DeviceRGB \
  -sPDFACompatibilityPolicy=1 \
  -sOutputFile=/home/ieffect/ghostscript/out/test_a.pdf \
  /home/ieffect/ghostscript/PDFA_def.ps \
  /home/ieffect/ghostscript/in/test.pdf \
  > /home/ieffect/ghostscript/out/gs-output.log \
  2> /home/ieffect/ghostscript/out/gs-error.log


This can then be called via QSH or as a server process in i-effect:

QSH CMD('/home/ieffect/data/ghostscript/ghostscript.sh')