Bug 699554 - Converting to PDF/A-1b with -dNOTRANSPARENCY fails validation
Summary: Converting to PDF/A-1b with -dNOTRANSPARENCY fails validation
Status: RESOLVED INVALID
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 9.23
Hardware: PC Windows 7
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-23 16:07 UTC by Balazs Molnar
Modified: 2018-07-25 08:06 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
All files. See Description for breakdown. (239.43 KB, application/x-zip-compressed)
2018-07-23 16:07 UTC, Balazs Molnar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Balazs Molnar 2018-07-23 16:07:02 UTC
Created attachment 15375 [details]
All files. See Description for breakdown.

Hi,

I am using Ghostscript to convert PDF documents in PDF/A-1b format. Generally it works really well but when the attached file (sample.pdf) is converted into PDF/A-1b format with the -dNOTRANSPARENCY switch the resulting PDF does not validate in Acrobat Pro Preflight and other online PDF/A validators. The transparency is not completely ignore/removed.

Full Ghostscript command: 
gswin64.exe -sDEVICE=pdfwrite -dBATCH -dNOOUTERSAVE -dAutoRotatePages=/None -dPDFSETTINGS=/prepress -dNOTRANSPARENCY -dPDFA -dPDFACompatibilityPolicy=1 -sProcessColorModel=DeviceRGB -sColorConversionStrategy=RGB -sOutputFile=sample_processed.pdf sample.ps sample.pdf

Preflight validation error message: Transparency used (blend mode not “Normal” nor “Compatible”)

Additionally when I open the generated file (sample_processed.pdf) and swap the z-order of the image and its shadow I can still see through the black shadow and make out the image behind.
When -dNOTRANSPARENCY is not used the validation passes but whole page is rasterized which is not the desired outcome.

Attached files:
command.txt - the Ghostscript command I use
sample.pdf - the input file
sample.ps - ps instructions file
sample_processed.pdf - the output file
sRGB_IEC61966-2-1_black_scaled.icc - the colour profile file
Preflight validation error.PNG - Acrobat Pro Preflight validation error

This also happens in other Ghostscript versions as well (9.16, 9.22 etc.)

Thank you for your help in advance.
Best regards,
Balazs
Comment 1 Ken Sharp 2018-07-24 16:07:33 UTC
(In reply to Balazs Molnar from comment #0)

> I am using Ghostscript to convert PDF documents in PDF/A-1b format.
> Generally it works really well but when the attached file (sample.pdf) is
> converted into PDF/A-1b format with the -dNOTRANSPARENCY switch the
> resulting PDF does not validate in Acrobat Pro Preflight and other online
> PDF/A validators. The transparency is not completely ignore/removed.

I'm afraid you are misusing the NOTRANSPARENCY switch. That does not remove transparency from the interpretation, it disables the rendering code's handling of transparency. Essentially the code which actually does the transparency blending to the rendered output is disabled.

The pdfwrite code does not use the transparency blending, it wants to maintain the transparency in the output, not render it.

So the NOTRANSPARENCY switch doesn't have the same effect for the pdfwrite device as it does for rendering devices.

Now because of the way the PDF interpreter currently works, some aspects of transparency are handled at the interpreter level, rather than the rendering code, and when NOTRANSPARENCY is true, those specific portions will be disabled, no matter what the device.

But the bottom line is that the pdfwrite device doesn't honour NOTRANSPARENCY, it isn't intended to and we won't be modifying it to do so.

When producing a PDF/A-1 file, any pages with transparency will be rendered to an image, thus preserving the appearance without violating the standard.

You should not use -dNOTRANSPARENCY with the pdfwrite device.
Comment 2 Balazs Molnar 2018-07-25 08:06:12 UTC
Thank you for the detailed explanation. I will not use the -dNOTRANSPARENCY switch when writing PDF.