veraPDF / veraPDF-library

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

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

Open THausherr opened 4 months ago

THausherr commented 4 months 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 4 months 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 4 months 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 4 months 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 4 months ago

It's fixed in the latest dev version 1.27.33.

THausherr commented 4 months ago

Thanks, it works!