Last update: 31 July 2018
When using the current color profiles from www.color.org the PDF/A documents generated with GPL Ghostscript produce the error "The value of the key N is 4 but must be 3." in most validators.
This error message is generated because the definition file "PDFA_def.ps" of Ghostscript 9.06 expects that all non grayscale color profiles are using the CMYK color space, which is no longer true for the recommended color profiles from www.color.org , this assumption can be changed by editing the definition file.
To change the assumed color profile of Ghostscript 9.06 simple change the value 4 to 3 in the following line inside the file "PDFA_def.ps" as shown below:
[{icc_PDFA} <</N systemdict /ProcessColorModel get /DeviceGray eq {1} {
4
} ifelse >> /PUT pdfmark
[{icc_PDFA} <</N systemdict /ProcessColorModel get /DeviceGray eq {1} {
3
} ifelse >> /PUT pdfmark