Skip to content

Commit

Permalink
Update rules with new properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Git User committed Oct 8, 2024
1 parent 24afef8 commit 37b049f
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 79 deletions.
12 changes: 6 additions & 6 deletions core/src/main/resources/org/verapdf/pdfa/validation/PDFA-1A.xml
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
<rule object="PDCMap">
<id specification="ISO_19005_1" clause="6.3.3.3" testNumber="1"/>
<description>All CMaps used within a conforming file, except Identity-H and Identity-V, shall be embedded in that file as described in PDF Reference 5.6.4</description>
<test>CMapName == "Identity-H" || CMapName == "Identity-V" || embeddedFile_size == 1</test>
<test>CMapName == "Identity-H" || CMapName == "Identity-V" || containsEmbeddedFile == true</test>
<error>
<message>A CMap is different from "Identity-H" or "Identity-V" and is not embedded</message>
<arguments/>
Expand All @@ -746,7 +746,7 @@
<rule object="PDFont">
<id specification="ISO_19005_1" clause="6.3.4" testNumber="1"/>
<description>The font programs for all fonts used within a conforming file shall be embedded within that file, as defined in PDF Reference 5.8, except when the fonts are used exclusively with text rendering mode 3</description>
<test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || fontFile_size == 1</test>
<test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || containsFontFile == true</test>
<error>
<message>The font program is not embedded</message>
<arguments/>
Expand Down Expand Up @@ -997,7 +997,7 @@
<rule object="PDAnnot">
<id specification="ISO_19005_1" clause="6.5.3" testNumber="5"/>
<description>If an annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, the value of the N key shall be an appearance subdictionary</description>
<test>AP != "N" || Subtype != "Widget" || FT != "Btn" || (N_type == "Dict" &amp;&amp; appearance_size &gt; 0)</test>
<test>AP != "N" || Subtype != "Widget" || FT != "Btn" || (N_type == "Dict" &amp;&amp; containsAppearances == true)</test>
<error>
<message>An annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, but the value of the N key is %1 instead of appearance subdictionary</message>
<arguments>
Expand Down Expand Up @@ -1094,7 +1094,7 @@
<rule object="PDDocument">
<id specification="ISO_19005_1" clause="6.7.2" testNumber="1"/>
<description>The document catalog dictionary of a conforming file shall contain the Metadata key. The metadata stream dictionary shall contain entry Type with value /Metadata and entry Subtype with value /XML</description>
<test>metadata_size == 1</test>
<test>containsMetadata == true</test>
<error>
<message>The document catalog dictionary doesn't contain metadata key or metadata stream dictionary does not contain either entry Type with value /Metadata or entry Subtype with value /XML</message>
<arguments/>
Expand Down Expand Up @@ -1551,7 +1551,7 @@
<rule object="MainXMPPackage">
<id specification="ISO_19005_1" clause="6.7.11" testNumber="1"/>
<description>The PDF/A version and conformance level of a file shall be specified using the PDF/A Identification extension schema</description>
<test>Identification_size == 1</test>
<test>containsPDFAIdentification == true</test>
<error>
<message>The document metadata stream doesn't contains PDF/A Identification Schema</message>
<arguments/>
Expand Down Expand Up @@ -1636,7 +1636,7 @@
<rule object="PDDocument">
<id specification="ISO_19005_1" clause="6.8.3.3" testNumber="1"/>
<description>The logical structure of the conforming file shall be described by a structure hierarchy rooted in the StructTreeRoot entry of the document catalog dictionary, as described in PDF Reference 9.6</description>
<test>StructTreeRoot_size == 1</test>
<test>containsStructTreeRoot == true</test>
<error>
<message>StructTreeRoot entry is not present in the document catalog</message>
<arguments/>
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/resources/org/verapdf/pdfa/validation/PDFA-1B.xml
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
<rule object="PDCMap">
<id specification="ISO_19005_1" clause="6.3.3.3" testNumber="1"/>
<description>All CMaps used within a conforming file, except Identity-H and Identity-V, shall be embedded in that file as described in PDF Reference 5.6.4</description>
<test>CMapName == "Identity-H" || CMapName == "Identity-V" || embeddedFile_size == 1</test>
<test>CMapName == "Identity-H" || CMapName == "Identity-V" || containsEmbeddedFile == true</test>
<error>
<message>A CMap is different from "Identity-H" or "Identity-V" and is not embedded</message>
<arguments/>
Expand All @@ -746,7 +746,7 @@
<rule object="PDFont">
<id specification="ISO_19005_1" clause="6.3.4" testNumber="1"/>
<description>The font programs for all fonts used within a conforming file shall be embedded within that file, as defined in PDF Reference 5.8, except when the fonts are used exclusively with text rendering mode 3</description>
<test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || fontFile_size == 1</test>
<test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || containsFontFile == true</test>
<error>
<message>The font program is not embedded</message>
<arguments/>
Expand Down Expand Up @@ -987,7 +987,7 @@
<rule object="PDAnnot">
<id specification="ISO_19005_1" clause="6.5.3" testNumber="5"/>
<description>If an annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, the value of the N key shall be an appearance subdictionary</description>
<test>AP != "N" || Subtype != "Widget" || FT != "Btn" || (N_type == "Dict" &amp;&amp; appearance_size &gt; 0)</test>
<test>AP != "N" || Subtype != "Widget" || FT != "Btn" || (N_type == "Dict" &amp;&amp; containsAppearances == true)</test>
<error>
<message>An annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, but the value of the N key is %1 instead of appearance subdictionary</message>
<arguments>
Expand Down Expand Up @@ -1084,7 +1084,7 @@
<rule object="PDDocument">
<id specification="ISO_19005_1" clause="6.7.2" testNumber="1"/>
<description>The document catalog dictionary of a conforming file shall contain the Metadata key. The metadata stream dictionary shall contain entry Type with value /Metadata and entry Subtype with value /XML</description>
<test>metadata_size == 1</test>
<test>containsMetadata == true</test>
<error>
<message>The document catalog dictionary doesn't contain metadata key or metadata stream dictionary does not contain either entry Type with value /Metadata or entry Subtype with value /XML</message>
<arguments/>
Expand Down Expand Up @@ -1541,7 +1541,7 @@
<rule object="MainXMPPackage">
<id specification="ISO_19005_1" clause="6.7.11" testNumber="1"/>
<description>The PDF/A version and conformance level of a file shall be specified using the PDF/A Identification extension schema</description>
<test>Identification_size == 1</test>
<test>containsPDFAIdentification == true</test>
<error>
<message>The document metadata stream doesn't contains PDF/A Identification Schema</message>
<arguments/>
Expand Down
18 changes: 9 additions & 9 deletions core/src/main/resources/org/verapdf/pdfa/validation/PDFA-2A.xml
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@
<rule object="PDCIDFont">
<id specification="ISO_19005_2" clause="6.2.11.3.2" testNumber="1"/>
<description>ISO 32000-1:2008, 9.7.4, Table 117 requires that all embedded Type 2 CIDFonts in the CIDFont dictionary shall contain a CIDToGIDMap entry that shall be a stream mapping from CIDs to glyph indices or the name Identity, as described in ISO 32000-1:2008, 9.7.4, Table 117</description>
<test>Subtype != "CIDFontType2" || CIDToGIDMap != null || fontFile_size == 0</test>
<test>Subtype != "CIDFontType2" || CIDToGIDMap != null || containsFontFile == false</test>
<error>
<message>A Type 2 CIDFont dictionary has missing or invalid CIDToGIDMap entry</message>
<arguments/>
Expand All @@ -858,7 +858,7 @@
<rule object="PDCMap">
<id specification="ISO_19005_2" clause="6.2.11.3.3" testNumber="1"/>
<description>All CMaps used within a PDF/A-2 file, except those listed in ISO 32000-1:2008, 9.7.5.2, Table 118, shall be embedded in that file as described in ISO 32000-1:2008, 9.7.5</description>
<test>CMapName == "Identity-H" || CMapName == "Identity-V" || CMapName == "GB-EUC-H" || CMapName == "GB-EUC-V" || CMapName == "GBpc-EUC-H" || CMapName == "GBpc-EUC-V" || CMapName == "GBK-EUC-H" || CMapName == "GBK-EUC-V" || CMapName == "GBKp-EUC-H" || CMapName == "GBKp-EUC-V" || CMapName == "GBK2K-H" || CMapName == "GBK2K-V" || CMapName == "UniGB-UCS2-H" || CMapName == "UniGB-UCS2-V" || CMapName == "UniGB-UFT16-H" || CMapName == "UniGB-UFT16-V" || CMapName == "B5pc-H" || CMapName == "B5pc-V" || CMapName == "HKscs-B5-H" || CMapName == "HKscs-B5-V" || CMapName == "ETen-B5-H" || CMapName == "ETen-B5-V" || CMapName == "ETenms-B5-H" || CMapName == "ETenms-B5-V" || CMapName == "CNS-EUC-H" || CMapName == "CNS-EUC-V" || CMapName == "UniCNS-UCS2-H" || CMapName == "UniCNS-UCS2-V" || CMapName == "UniCNS-UFT16-H" || CMapName == "UniCNS-UTF16-V" || CMapName == "83pv-RKSJ-H" || CMapName == "90ms-RKSJ-H" || CMapName == "90ms-RKSJ-V" || CMapName == "90msp-RKSJ-H" || CMapName == "90msp-RKSJ-V" || CMapName == "90pv-RKSJ-H" || CMapName == "Add-RKSJ-H" || CMapName == "Add-RKSJ-V" || CMapName == "EUC-H" || CMapName == "EUC-V" || CMapName == "Ext-RKSJ-H" || CMapName == "Ext-RKSJ-V" || CMapName == "H" || CMapName == "V" || CMapName == "UniJIS-UCS2-H" || CMapName == "UniJIS-UCS2-V" || CMapName == "UniJIS-UCS2-HW-H" || CMapName == "UniJIS-UCS2-HW-V" || CMapName == "UniJIS-UTF16-H" || CMapName == "UniJIS-UTF16-V" || CMapName == "KSC-EUC-H" || CMapName == "KSC-EUC-V" || CMapName == "KSCms-UHC-H" || CMapName == "KSCms-UHC-V" || CMapName == "KSCms-UHC-HW-H" || CMapName == "KSCms-UHC-HW-V" || CMapName == "KSCpc-EUC-H" || CMapName == "UniKS-UCS2-H" || CMapName == "UniKS-UCS2-V" || CMapName == "UniKS-UTF16-H" || CMapName == "UniKS-UTF16-V" || embeddedFile_size == 1</test>
<test>CMapName == "Identity-H" || CMapName == "Identity-V" || CMapName == "GB-EUC-H" || CMapName == "GB-EUC-V" || CMapName == "GBpc-EUC-H" || CMapName == "GBpc-EUC-V" || CMapName == "GBK-EUC-H" || CMapName == "GBK-EUC-V" || CMapName == "GBKp-EUC-H" || CMapName == "GBKp-EUC-V" || CMapName == "GBK2K-H" || CMapName == "GBK2K-V" || CMapName == "UniGB-UCS2-H" || CMapName == "UniGB-UCS2-V" || CMapName == "UniGB-UFT16-H" || CMapName == "UniGB-UFT16-V" || CMapName == "B5pc-H" || CMapName == "B5pc-V" || CMapName == "HKscs-B5-H" || CMapName == "HKscs-B5-V" || CMapName == "ETen-B5-H" || CMapName == "ETen-B5-V" || CMapName == "ETenms-B5-H" || CMapName == "ETenms-B5-V" || CMapName == "CNS-EUC-H" || CMapName == "CNS-EUC-V" || CMapName == "UniCNS-UCS2-H" || CMapName == "UniCNS-UCS2-V" || CMapName == "UniCNS-UFT16-H" || CMapName == "UniCNS-UTF16-V" || CMapName == "83pv-RKSJ-H" || CMapName == "90ms-RKSJ-H" || CMapName == "90ms-RKSJ-V" || CMapName == "90msp-RKSJ-H" || CMapName == "90msp-RKSJ-V" || CMapName == "90pv-RKSJ-H" || CMapName == "Add-RKSJ-H" || CMapName == "Add-RKSJ-V" || CMapName == "EUC-H" || CMapName == "EUC-V" || CMapName == "Ext-RKSJ-H" || CMapName == "Ext-RKSJ-V" || CMapName == "H" || CMapName == "V" || CMapName == "UniJIS-UCS2-H" || CMapName == "UniJIS-UCS2-V" || CMapName == "UniJIS-UCS2-HW-H" || CMapName == "UniJIS-UCS2-HW-V" || CMapName == "UniJIS-UTF16-H" || CMapName == "UniJIS-UTF16-V" || CMapName == "KSC-EUC-H" || CMapName == "KSC-EUC-V" || CMapName == "KSCms-UHC-H" || CMapName == "KSCms-UHC-V" || CMapName == "KSCms-UHC-HW-H" || CMapName == "KSCms-UHC-HW-V" || CMapName == "KSCpc-EUC-H" || CMapName == "UniKS-UCS2-H" || CMapName == "UniKS-UCS2-V" || CMapName == "UniKS-UTF16-H" || CMapName == "UniKS-UTF16-V" || containsEmbeddedFile == true</test>
<error>
<message>A non-standard CMap %1 is not embedded</message>
<arguments>
Expand Down Expand Up @@ -899,7 +899,7 @@
<rule object="PDFont">
<id specification="ISO_19005_2" clause="6.2.11.4.1" testNumber="1"/>
<description>The font programs for all fonts used for rendering within a conforming file shall be embedded within that file, as defined in ISO 32000-1:2008, 9.9</description>
<test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || fontFile_size == 1</test>
<test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || containsFontFile == true</test>
<error>
<message>The font program is not embedded</message>
<arguments/>
Expand All @@ -923,7 +923,7 @@
<rule object="PDType1Font">
<id specification="ISO_19005_2" clause="6.2.11.4.2" testNumber="1"/>
<description>If the FontDescriptor dictionary of an embedded Type 1 font contains a CharSet string, then it shall list the character names of all glyphs present in the font program, regardless of whether a glyph in the font is referenced or used by the PDF or not</description>
<test>fontFile_size == 0 || fontName.search(/[A-Z]{6}\+/) != 0 || CharSet == null || charSetListsAllGlyphs == true</test>
<test>containsFontFile == false || fontName.search(/[A-Z]{6}\+/) != 0 || CharSet == null || charSetListsAllGlyphs == true</test>
<error>
<message>A CharSet entry in the Descriptor dictionary of a Type1 font incorrectly lists glyphs present in the font program</message>
<arguments/>
Expand All @@ -933,7 +933,7 @@
<rule object="PDCIDFont">
<id specification="ISO_19005_2" clause="6.2.11.4.2" testNumber="2"/>
<description>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</description>
<test>fontFile_size == 0 || fontName.search(/[A-Z]{6}\+/) != 0 || containsCIDSet == false || cidSetListsAllGlyphs == true</test>
<test>containsFontFile == false || fontName.search(/[A-Z]{6}\+/) != 0 || containsCIDSet == false || cidSetListsAllGlyphs == true</test>
<error>
<message>A CIDSet entry in the Font descriptor does not correctly identify all glyphs present in the embedded font subset</message>
<arguments/>
Expand Down Expand Up @@ -1111,7 +1111,7 @@
<rule object="PDAnnot">
<id specification="ISO_19005_2" clause="6.3.3" testNumber="3"/>
<description>If an annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, the value of the N key shall be an appearance subdictionary</description>
<test>AP != "N" || Subtype != "Widget" || FT != "Btn" || (N_type == "Dict" &amp;&amp; appearance_size &gt; 0)</test>
<test>AP != "N" || Subtype != "Widget" || FT != "Btn" || (N_type == "Dict" &amp;&amp; containsAppearances == true)</test>
<error>
<message>An annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, but the value of the N key is %1 instead of appearance subdictionary</message>
<arguments>
Expand Down Expand Up @@ -1277,7 +1277,7 @@
<rule object="PDDocument">
<id specification="ISO_19005_2" clause="6.6.2.1" testNumber="1"/>
<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 entry Type with value /Metadata and entry Subtype with value /XML</description>
<test>metadata_size == 1</test>
<test>containsMetadata == true</test>
<error>
<message>The document catalog dictionary doesn't contain metadata key or metadata stream dictionary does not contain either entry Type with value /Metadata or entry Subtype with value /XML</message>
<arguments/>
Expand Down Expand Up @@ -1608,7 +1608,7 @@
<rule object="MainXMPPackage">
<id specification="ISO_19005_2" clause="6.6.4" testNumber="1"/>
<description>The PDF/A version and conformance level of a file shall be specified using the PDF/A Identification extension schema</description>
<test>Identification_size == 1</test>
<test>containsPDFAIdentification == true</test>
<error>
<message>The document metadata stream doesn't contains PDF/A Identification Schema</message>
<arguments/>
Expand Down Expand Up @@ -1705,7 +1705,7 @@
<rule object="PDDocument">
<id specification="ISO_19005_2" clause="6.7.3.3" testNumber="1"/>
<description>The logical structure of the conforming file shall be described by a structure hierarchy rooted in the StructTreeRoot entry of the document's Catalog dictionary, as described in ISO 32000-1:2008, 14.7</description>
<test>StructTreeRoot_size == 1</test>
<test>containsStructTreeRoot == true</test>
<error>
<message>StructTreeRoot entry is not present in the document catalog</message>
<arguments/>
Expand Down
Loading

0 comments on commit 37b049f

Please sign in to comment.