veraPDF / veraPDF-library

Industry supported, open source PDF/A validation library
http://verapdf.org/software
GNU General Public License v3.0
270 stars 48 forks source link

Issue with Red, Green and Blue halftones #1399

Closed vladgrind closed 7 months ago

vladgrind commented 8 months ago

When validating a PDF, which has Red, Green, Blue or Gray halftones defined, veraPDF always states that the PDF is not PDF/A compliant with the following message: Error message: Custom TransferFunction in a Halftone dictionary is not permitted for primary (CMYK) colorants. Description: The TransferFunction key in a halftone dictionary shall be used only as required by ISO 32000-1

I have attached very simple PDF, which uses only RGB colors: pdfa_ht.pdf

The doc contains ExtGState resource with Red, Green and Blue halftones, and without any transfer function for the halftones. But veraPdf complains about it. If I validate the same PDF with Preflight then it states that it is PDF/A compliant. So, probably one of the validation rules for halftones is not correctly defined inside veraPdf?

Additional info about the validation check: According to the error report, the following check fails:

colorantName=='Default' || ((colorantName==null || colorantName=='Cyan' || colorantName=='Magenta' || colorantName=='Yellow' || colorantName=='Black') ? TransferFunction==null : TransferFunction != null)

In my opinion, the check should be extended with Red, Green, Blue and Gray halftones:

colorantName=='Default' || ((colorantName==null || colorantName=='Cyan' || colorantName=='Magenta' || colorantName=='Yellow' || colorantName=='Black' || colorantName=='Red' || colorantName=='Green' || colorantName=='Blue' || colorantName=='Gray') ? TransferFunction==null : TransferFunction != null)

Could you please review this issue and confirm (or deny) the problem inside veraPdf. Thank you in advance.

bdoubrov commented 7 months ago

The question of whether Red, Green, Blue should be treated as primary colorants or not has been heavily debated. See https://github.com/pdf-association/pdf-issues/issues/310 .

We'll adjust veraPDF implementation to reflect the resolution of this discussion

vladgrind commented 7 months ago

Hello Boris,

Thank you very much for your response: now it has become clearer to me. Also, I found initial question about the halftones, which caused the latest changes in veraPDF for halftone validation:
https://github.com/veraPDF/veraPDF-corpus/issues/238

So, is my understanding correct that the latest check in veraPDF completely reflects the current state of the discussion, but in the future, it could be changed, according to the discussion result?

Best regards, Vlad.

bdoubrov commented 7 months ago

So, is my understanding correct that the latest check in veraPDF completely reflects the current state of the discussion, but in the future, it could be changed, according to the discussion result?

Yes, this is fully correct! So, if you don't mind we'll close this issue for now. But might need to reopen base don the outcome of the PDF TWG resolution

vladgrind commented 7 months ago

All is clear for now: no objection to close this issue. Thank you!