Search code examples
ghostscriptfile-conversionpdfa

Ghostscript pdf to pdf/a-3 conversion results in a colorspace validation error by VeraPDF


I'm converting a pdf 1.5 file via. the latest Ghostscript cli to pdf/a-3 format, but by validating the output file with VeraPDF, I get an error.

I used the command:

gswin64 -dPDFA=3 -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=UseDeviceIndependentColor -sOutputFile=output.pdf input.pdf
  • but by validating the output file with VeraPDF, I get the following colorspace error:

"DeviceRGB shall only be used if a device independent DefaultRGB colour space has been set when the DeviceRGB colour space is used, or if the file has a PDF/A OutputIntent that contains an RGB destination profile."

VeraPDF validation error 6.2.4.3

What could be wrong here (with the commands?)?


Solution

  • The solution was to upgrade to Ghostscript 10.3.0 and use of this command:

    -sDEVICE=pdfwrite -o good.pdf -sColorConversionStrategy=RGB -dCompressPages=false -dWriteObjStms=false -dWriteXRefStm=false -dPDFA=3 --permit-file-read=/ghostpdl/iccprofiles/default_rgb.icc pdfa_def.ps input.pdf
    

    with an icc-profile defined in pdfa_def.ps as:

    % Define an ICC profile :
    /ICCProfile (/ghostpdl/iccprofiles/default_rgb.icc) % Customise
    def
    

    as described here:

    https://bugs.ghostscript.com/show_bug.cgi?id=707450