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

Improve error message on ISO 19005-2:2011, Clause: 6.6.2.1, Test number: 1 #1450

Open THausherr opened 3 months ago

THausherr commented 3 months ago

This is somewhat related to #1398 . The error message with the attached file is "The Catalog dictionary of a conforming file shall contain the Metadata key whose value is a metadata stream as defined in ISO 32000-1:2008, 14.3.2." However what's really happening is that /Subtype /XML /Type Metadata are missing in the metadata stream object. It would be nice if this error message would be improved so that the user knows what the problem is. The current message confused another user: https://stackoverflow.com/questions/78474081

pdfa2b-merged.pdf

same file but only XML missing:

pdfa2b-merged2.pdf

Version: 1.26.2 / 2024-05-19T13:33:00+02:00

bdoubrov commented 3 months ago

Yes, this issue with incorrect /Subtype spelling seems to be quite common. What about the following description:

The Catalog dictionary of a conforming file shall contain the Metadata key whose value is a metadata stream as defined in ISO 32000-1:2008, 14.3.2. The metadata stream dictionary shall contain entries /Type /Metadata and /Subtype /XML

and the error message:

The document catalog dictionary doesn't contain Metadata key, or metadata stream has incorrect syntax

Additionally, in the wiki we can provide more details including the correct syntax and typical issues.

MaximPlusov commented 1 month ago

It's fixed in the latest dev version 1.27.31.