veraPDF / veraPDF-library

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

PDF/A-3b file with 1 glyph invalid despite having /CIDSet with 0x80 #1462

Open THausherr opened 1 month ago

THausherr commented 1 month ago

The attached file fails validation "If the FontDescriptor dictionary of an embedded CID font contains a CIDSet stream, then it shall identify all CIDs which are present in the font program, regardless of whether a CID in the font is referenced or used by the PDF or not" pdfa3.pdf The embedded font has 1 glyph with gid 0, and the CIDSet stream has 1 entry in the highest bit, so unless I missed something, this file is OK.

Versions 1.26.2 and 1.27.28

MaximPlusov commented 1 month ago

@THausherr thanks for reporting this issue!

In this case, veraPDF determines number of сids in the font program based on CIDToGIDMap that contains 5 2-byte values. image_1

THausherr commented 1 month ago

The length is the "compressed" length, it's really just one 2 byte value.

I tried generating the same file but with CIDSet and CIDToGIDMap uncompressed and now it validates! pdfa3_unc.pdf

MaximPlusov commented 1 month ago

Thanks. Now I see the mistake we made during parsing of the original file.

To be fixed in one of the nearest dev versions.

MaximPlusov commented 1 month ago

It's fixed in the latest dev version 1.27.33.

THausherr commented 1 month ago

Thanks, it works!