Skip to content

Commit 24afef8

Browse files
author
Git User
committed
Update rules with new properties
1 parent 78300ab commit 24afef8

File tree

4 files changed

+47
-47
lines changed

4 files changed

+47
-47
lines changed

core/src/main/resources/org/verapdf/pdfa/validation/PDFUA-1.xml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<rule object="MainXMPPackage" tags="metadata">
1010
<id specification="ISO_14289_1" clause="5" testNumber="1"/>
1111
<description>The PDF/UA version and conformance level of a file shall be specified using the PDF/UA Identification extension schema</description>
12-
<test>UAIdentification_size == 1</test>
12+
<test>containsPDFUAIdentification == true</test>
1313
<error>
1414
<message>The document metadata stream doesn't contains PDF/UA Identification Schema</message>
1515
<arguments/>
@@ -153,7 +153,7 @@
153153
<rule object="PDDocument" tags="metadata">
154154
<id specification="ISO_14289_1" clause="7.1" testNumber="8"/>
155155
<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>
156-
<test>metadata_size == 1</test>
156+
<test>containsMetadata == true</test>
157157
<error>
158158
<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>
159159
<arguments/>
@@ -188,7 +188,7 @@
188188
<rule object="PDDocument" tags="structure">
189189
<id specification="ISO_14289_1" clause="7.1" testNumber="11"/>
190190
<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 ISO 32000-1:2008, 14.7</description>
191-
<test>StructTreeRoot_size == 1</test>
191+
<test>containsStructTreeRoot == true</test>
192192
<error>
193193
<message>StructTreeRoot entry is not present in the document catalog</message>
194194
<arguments/>
@@ -212,7 +212,7 @@
212212
<rule object="PDOutline" tags="lang">
213213
<id specification="ISO_14289_1" clause="7.2" testNumber="2"/>
214214
<description>Natural language in the Outline entries shall be determined</description>
215-
<test>gSizeCatalogLang != 0</test>
215+
<test>gContainsCatalogLang == true</test>
216216
<error>
217217
<message>Natural language in the Outline entries cannot be determined</message>
218218
<arguments/>
@@ -466,7 +466,7 @@
466466
<rule object="PDStructElem" tags="structure,lang">
467467
<id specification="ISO_14289_1" clause="7.2" testNumber="21"/>
468468
<description>Natural language for text in ActualText attribute shall be determined</description>
469-
<test>ActualText == null || Lang_size != 0 || parentLang != null || gSizeCatalogLang != 0</test>
469+
<test>ActualText == null || containsLang == true || parentLang != null || gContainsCatalogLang == true</test>
470470
<error>
471471
<message>Natural language for text in ActualText attribute cannot be determined</message>
472472
<arguments/>
@@ -476,7 +476,7 @@
476476
<rule object="PDStructElem" tags="structure,lang">
477477
<id specification="ISO_14289_1" clause="7.2" testNumber="22"/>
478478
<description>Natural language for text in Alt attribute shall be determined</description>
479-
<test>Alt == null || Lang_size != 0 || parentLang != null || gSizeCatalogLang != 0</test>
479+
<test>Alt == null || containsLang == true || parentLang != null || gContainsCatalogLang == true</test>
480480
<error>
481481
<message>Natural language for text in Alt attribute cannot be determined</message>
482482
<arguments/>
@@ -486,7 +486,7 @@
486486
<rule object="PDStructElem" tags="structure,lang">
487487
<id specification="ISO_14289_1" clause="7.2" testNumber="23"/>
488488
<description>Natural language for text in E attribute shall be determined</description>
489-
<test>E == null || Lang_size != 0 || parentLang != null || gSizeCatalogLang != 0</test>
489+
<test>E == null || containsLang == true || parentLang != null || gContainsCatalogLang == true</test>
490490
<error>
491491
<message>Natural language for text in E attribute cannot be determined</message>
492492
<arguments/>
@@ -496,7 +496,7 @@
496496
<rule object="PDAnnot" tags="lang,annotation,structure">
497497
<id specification="ISO_14289_1" clause="7.2" testNumber="24"/>
498498
<description>Natural language in the Contents entry for annotations shall be determined</description>
499-
<test>Contents == null || Lang_size != 0 || gSizeCatalogLang != 0</test>
499+
<test>Contents == null || containsLang == true || gContainsCatalogLang == true</test>
500500
<error>
501501
<message>Natural language in the Contents entry for annotations cannot be determined</message>
502502
<arguments/>
@@ -506,7 +506,7 @@
506506
<rule object="PDFormField" tags="structure,lang">
507507
<id specification="ISO_14289_1" clause="7.2" testNumber="25"/>
508508
<description>Natural language in the TU key for form fields shall be determined</description>
509-
<test>TU == null || Lang_size != 0 || gSizeCatalogLang != 0</test>
509+
<test>TU == null || containsLang == true || gContainsCatalogLang == true</test>
510510
<error>
511511
<message>Natural language in the TU key for form fields cannot be determined</message>
512512
<arguments/>
@@ -574,7 +574,7 @@
574574
<rule object="SEMarkedContent" tags="lang,alt-text">
575575
<id specification="ISO_14289_1" clause="7.2" testNumber="30"/>
576576
<description>Natural language for text in ActualText attribute in Span Marked Content shall be determined</description>
577-
<test>tag != 'Span' || ActualText == null || Lang != null || inheritedLang != null || gSizeCatalogLang != 0</test>
577+
<test>tag != 'Span' || ActualText == null || Lang != null || inheritedLang != null || gContainsCatalogLang == true</test>
578578
<error>
579579
<message>Natural language for text in ActualText attribute in Span Marked Content cannot be determined</message>
580580
<arguments/>
@@ -584,7 +584,7 @@
584584
<rule object="SEMarkedContent" tags="lang,alt-text">
585585
<id specification="ISO_14289_1" clause="7.2" testNumber="31"/>
586586
<description>Natural language for text in Alt attribute in Span Marked Content shall be determined</description>
587-
<test>tag != 'Span' || Alt == null || Lang != null || inheritedLang != null || gSizeCatalogLang != 0</test>
587+
<test>tag != 'Span' || Alt == null || Lang != null || inheritedLang != null || gContainsCatalogLang == true</test>
588588
<error>
589589
<message>Natural language for text in Alt attribute in Span Marked Content cannot be determined</message>
590590
<arguments/>
@@ -594,7 +594,7 @@
594594
<rule object="SEMarkedContent" tags="lang,alt-text">
595595
<id specification="ISO_14289_1" clause="7.2" testNumber="32"/>
596596
<description>Natural language for text in E attribute in Span Marked Content shall be determined</description>
597-
<test>tag != 'Span' || E == null || Lang != null || inheritedLang != null || gSizeCatalogLang != 0</test>
597+
<test>tag != 'Span' || E == null || Lang != null || inheritedLang != null || gContainsCatalogLang == true</test>
598598
<error>
599599
<message>Natural language for text in E attribute in Span Marked Content cannot be determined</message>
600600
<arguments/>
@@ -604,7 +604,7 @@
604604
<rule object="XMPLangAlt" deferred="true" tags="lang,metadata">
605605
<id specification="ISO_14289_1" clause="7.2" testNumber="33"/>
606606
<description>Natural language for document metadata shall be determined</description>
607-
<test>xDefault == false || gSizeCatalogLang != 0</test>
607+
<test>xDefault == false || gContainsCatalogLang == true</test>
608608
<error>
609609
<message>Natural language for document metadata cannot be determined</message>
610610
<arguments/>
@@ -614,7 +614,7 @@
614614
<rule object="SETextItem" tags="lang,text">
615615
<id specification="ISO_14289_1" clause="7.2" testNumber="34"/>
616616
<description>Natural language for text in page content shall be determined</description>
617-
<test>gSizeCatalogLang != 0 || Lang != null</test>
617+
<test>gContainsCatalogLang == true || Lang != null</test>
618618
<error>
619619
<message>Natural language for text in page content cannot be determined</message>
620620
<arguments/>
@@ -958,7 +958,7 @@
958958
<rule object="PDPage" tags="page">
959959
<id specification="ISO_14289_1" clause="7.18.3" testNumber="1"/>
960960
<description>Every page on which there is an annotation shall contain in its page dictionary the key Tabs, and its value shall be S</description>
961-
<test>annots_size == 0 || Tabs == 'S'</test>
961+
<test>containsAnnotations == false || Tabs == 'S'</test>
962962
<error>
963963
<message>A page with annotation(s) contains Tabs key with value %1 instead of S</message>
964964
<arguments>
@@ -1101,7 +1101,7 @@
11011101
<rule object="PDCIDFont" tags="font">
11021102
<id specification="ISO_14289_1" clause="7.21.3.2" testNumber="1"/>
11031103
<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>
1104-
<test>Subtype != "CIDFontType2" || CIDToGIDMap != null || fontFile_size == 0</test>
1104+
<test>Subtype != "CIDFontType2" || CIDToGIDMap != null || containsFontFile == false</test>
11051105
<error>
11061106
<message>A Type 2 CIDFont dictionary has missing or invalid CIDToGIDMap entry</message>
11071107
<arguments/>
@@ -1113,7 +1113,7 @@
11131113
<rule object="PDCMap" tags="font">
11141114
<id specification="ISO_14289_1" clause="7.21.3.3" testNumber="1"/>
11151115
<description>All CMaps used within a PDF/UA 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>
1116-
<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>
1116+
<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>
11171117
<error>
11181118
<message>A non-standard CMap %1 is not embedded</message>
11191119
<arguments>
@@ -1154,7 +1154,7 @@
11541154
<rule object="PDFont" tags="font">
11551155
<id specification="ISO_14289_1" clause="7.21.4.1" testNumber="1"/>
11561156
<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>
1157-
<test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || fontFile_size == 1</test>
1157+
<test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || containsFontFile == true</test>
11581158
<error>
11591159
<message>The font program is not embedded</message>
11601160
<arguments/>
@@ -1179,7 +1179,7 @@
11791179
<rule object="PDType1Font" tags="font">
11801180
<id specification="ISO_14289_1" clause="7.21.4.2" testNumber="1"/>
11811181
<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>
1182-
<test>fontFile_size == 0 || fontName.search(/[A-Z]{6}\+/) != 0 || CharSet == null || charSetListsAllGlyphs == true</test>
1182+
<test>containsFontFile == false || fontName.search(/[A-Z]{6}\+/) != 0 || CharSet == null || charSetListsAllGlyphs == true</test>
11831183
<error>
11841184
<message>A CharSet entry in the Descriptor dictionary of a Type1 font incorrectly lists glyphs present in the font program</message>
11851185
<arguments/>
@@ -1189,7 +1189,7 @@
11891189
<rule object="PDCIDFont" tags="font">
11901190
<id specification="ISO_14289_1" clause="7.21.4.2" testNumber="2"/>
11911191
<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>
1192-
<test>fontFile_size == 0 || fontName.search(/[A-Z]{6}\+/) != 0 || containsCIDSet == false || cidSetListsAllGlyphs == true</test>
1192+
<test>containsFontFile == false || fontName.search(/[A-Z]{6}\+/) != 0 || containsCIDSet == false || cidSetListsAllGlyphs == true</test>
11931193
<error>
11941194
<message>A CIDSet entry in the Font descriptor does not correctly identify all glyphs present in the embedded font subset</message>
11951195
<arguments/>
@@ -1289,9 +1289,9 @@
12891289
</rule>
12901290
</rules>
12911291
<variables>
1292-
<variable name="gSizeCatalogLang" object="PDDocument">
1293-
<defaultValue>0</defaultValue>
1294-
<value>Lang_size</value>
1292+
<variable name="gContainsCatalogLang" object="PDDocument">
1293+
<defaultValue>false</defaultValue>
1294+
<value>containsLang</value>
12951295
</variable>
12961296
<variable name="usesH" object="SEH">
12971297
<defaultValue>false</defaultValue>

0 commit comments

Comments
 (0)