pdfv-core 0.1.1

Core validation contracts and library API for pdfv.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="PDFUA_1">
    <details creator="veraPDF Consortium" created="2020-04-07T11:37:52.486Z">
        <name>PDF/UA-1 validation profile</name>
        <description>Validation rules against ISO 14289-1:2014</description>
    </details>
    <hash></hash>
    <rules>
        <rule object="MainXMPPackage" tags="metadata">
            <id specification="ISO_14289_1" clause="5" testNumber="1"/>
            <description>The PDF/UA version and conformance level of a file shall be specified using the PDF/UA Identification extension schema</description>
            <test>containsPDFUAIdentification == true</test>
            <error>
                <message>The document metadata stream doesn't contain PDF/UA Identification Schema</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDFUAIdentification" tags="metadata">
            <id specification="ISO_14289_1" clause="5" testNumber="2"/>
            <description>The value of "pdfuaid:part" shall be the part number of the International Standard to which the file conforms</description>
            <test>part == 1</test>
            <error>
                <message>The "part" property of the PDF/UA Identification Schema is %1 instead of 1 for PDF/UA-1 conforming file</message>
                <arguments>
                    <argument>part</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFUAIdentification" tags="metadata">
            <id specification="ISO_14289_1" clause="5" testNumber="3"/>
            <description>Property "part" of the PDF/UA Identification Schema shall have namespace prefix "pdfuaid"</description>
            <test>partPrefix == null || partPrefix == "pdfuaid"</test>
            <error>
                <message>Property "part" of the PDF/UA Identification Schema has invalid namespace prefix %1</message>
                <arguments>
                    <argument>partPrefix</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFUAIdentification" tags="metadata">
            <id specification="ISO_14289_1" clause="5" testNumber="4"/>
            <description>Property "amd" of the PDF/UA Identification Schema shall have namespace prefix "pdfuaid"</description>
            <test>amdPrefix == null || amdPrefix == "pdfuaid"</test>
            <error>
                <message>Property "amd" of the PDF/UA Identification Schema has invalid namespace prefix %1</message>
                <arguments>
                    <argument>amdPrefix</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFUAIdentification" tags="metadata">
            <id specification="ISO_14289_1" clause="5" testNumber="5"/>
            <description>Property "corr" of the PDF/UA Identification Schema shall have namespace prefix "pdfuaid"</description>
            <test>corrPrefix == null || corrPrefix == "pdfuaid"</test>
            <error>
                <message>Property "corr" of the PDF/UA Identification Schema has invalid namespace prefix %1</message>
                <arguments>
                    <argument>corrPrefix</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument" tags="syntax">
            <id specification="ISO_14289_1" clause="6.1" testNumber="1"/>
            <description>The file header shall consist of "%PDF-1.n" followed by a single EOL marker, where 'n' is a single digit number between 0 (30h) and 7 (37h)</description>
            <test>/^%PDF-1\.[0-7]$/.test(header)</test>
            <error>
                <message>File header %1 does not match the pattern %PDF-1.n, where 'n' is a single digit number between 0 and 7</message>
                <arguments>
                    <argument>header</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument" tags="syntax">
            <id specification="ISO_14289_1" clause="6.2" testNumber="1"/>
            <description>The document catalog dictionary shall include a MarkInfo dictionary containing an entry, Marked, whose value shall be true</description>
            <test>Marked == true</test>
            <error>
                <message>MarkInfo dictionary is not present in the document catalog, or Marked entry is set to false or is not present in the MarkInfo dictionary (MarkInfo = %1, Marked = %2)</message>
                <arguments>
                    <argument>MarkInfo</argument>
                    <argument>Marked</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.7.1"/>
            </references>
        </rule>
        <rule object="SEMarkedContent" tags="artifact">
            <id specification="ISO_14289_1" clause="7.1" testNumber="1"/>
            <description>Content marked as Artifact should not be present inside tagged content</description>
            <test>tag != 'Artifact' || isTaggedContent == false</test>
            <error>
                <message>Content marked as Artifact is present inside tagged content (parent struct element %1)</message>
                <arguments>
                    <argument>parentStructureElementObjectKey</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="SEMarkedContent" tags="artifact">
            <id specification="ISO_14289_1" clause="7.1" testNumber="2"/>
            <description>Tagged content should not be present inside content marked as Artifact</description>
            <test>isTaggedContent == false || parentsTags.contains('Artifact') == false</test>
            <error>
                <message>Tagged content (parent struct element %1) is present inside content marked as Artifact</message>
                <arguments>
                    <argument>parentStructureElementObjectKey</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="SESimpleContentItem" tags="artifact">
            <id specification="ISO_14289_1" clause="7.1" testNumber="3"/>
            <description>Content shall be marked as Artifact or tagged as real content</description>
            <test>isTaggedContent == true || parentsTags.contains('Artifact') == true</test>
            <error>
                <message>Content is neither marked as Artifact nor tagged as real content</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument" tags="syntax">
            <id specification="ISO_14289_1" clause="7.1" testNumber="4"/>
            <description>Files shall have a Suspects value of false(ISO 32000-1:2008, Table 321)</description>
            <test>Suspects != true</test>
            <error>
                <message>Suspects entry has a value of true</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.7.1"/>
            </references>
        </rule>
        <rule object="SENonStandard" tags="structure">
            <id specification="ISO_14289_1" clause="7.1" testNumber="5"/>
            <description>All non-standard structure types shall be mapped to the nearest functionally equivalent standard type, as defined in ISO 32000-1:2008, 14.8.4, in the role map dictionary of the structure tree root. This mapping may be indirect; within the role map a non-standard type can map directly to another non-standard type, but eventually the mapping shall terminate at a standard type</description>
            <test>isNotMappedToStandardType == false</test>
            <error>
                <message>Non-standard structure type %1 is not mapped to a standard type</message>
                <arguments>
                    <argument>valueS</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4"/>
            </references>
        </rule>
        <rule object="PDStructElem" tags="structure">
            <id specification="ISO_14289_1" clause="7.1" testNumber="6"/>
            <description>A circular mapping shall not exist</description>
            <test>circularMappingExist != true</test>
            <error>
                <message>A circular mapping exists for %1 structure type</message>
                <arguments>
                    <argument>valueS</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDStructElem" tags="structure">
            <id specification="ISO_14289_1" clause="7.1" testNumber="7"/>
            <description>Standard tags defined in ISO 32000-1:2008, 14.8.4, shall not be remapped</description>
            <test>remappedStandardType == null</test>
            <error>
                <message>Standard type %1 is remapped</message>
                <arguments>
                    <argument>remappedStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4"/>
            </references>
        </rule>
        <rule object="PDDocument" tags="metadata">
            <id specification="ISO_14289_1" clause="7.1" testNumber="8"/>
            <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>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/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.3.2"/>
            </references>
        </rule>
        <rule object="MainXMPPackage" tags="metadata">
            <id specification="ISO_14289_1" clause="7.1" testNumber="9"/>
            <description>The Metadata stream in the document's catalog dictionary shall contain a dc:title entry, where dc is the recommended prefix for the Dublin Core metadata schema as defined in the XMP specification, which clearly identifies the document</description>
            <test>dc_title != null</test>
            <error>
                <message>Metadata stream does not contain dc:title</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument" tags="syntax">
            <id specification="ISO_14289_1" clause="7.1" testNumber="10"/>
            <description>The document catalog dictionary shall include a ViewerPreferences dictionary containing a DisplayDocTitle key, whose value shall be true</description>
            <test>DisplayDocTitle == true</test>
            <error>
                <message>ViewerPreferences dictionary is not present in the document Catalog, or DisplayDocTitle key is set to false or is not present in the ViewerPreferences dictionary (ViewerPreferences = %1, DisplayDocTitle = %2)</message>
                <arguments>
                    <argument>ViewerPreferences</argument>
                    <argument>DisplayDocTitle</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDDocument" tags="structure">
            <id specification="ISO_14289_1" clause="7.1" testNumber="11"/>
            <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>
            <test>containsStructTreeRoot == true</test>
            <error>
                <message>StructTreeRoot entry is not present in the document catalog</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.7"/>
            </references>
        </rule>
        <rule object="PDStructElem" tags="structure">
            <id specification="ISO_14289_1" clause="7.1" testNumber="12"/>
            <description>A structure element dictionary shall contain the P (parent) entry according to ISO 32000-1:2008, 14.7.2, Table 355</description>
            <test>containsParent == true</test>
            <error>
                <message>A structure element dictionary does not contain the P (parent) entry</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.7.2, Table 355"/>
            </references>
        </rule>
        <rule object="PDOutline" tags="lang">
            <id specification="ISO_14289_1" clause="7.2" testNumber="2"/>
            <description>Natural language in the Outline entries shall be determined</description>
            <test>gContainsCatalogLang == true</test>
            <error>
                <message>Natural language in the Outline entries cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="3"/>
            <description>Table element may contain only TR, THead, TBody, TFoot and Caption elements</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TR' &amp;&amp; elem != 'THead' &amp;&amp; elem != 'TBody' &amp;&amp; elem != 'TFoot' &amp;&amp; elem != 'Caption').length == 0 || kidsStandardTypes == ''</test>
            <error>
                <message>Table element contains %1 element(s) instead of TR, THead, TBode, TFoot or Caption</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TR' &amp;&amp; elem != 'THead'
                        &amp;&amp; elem != 'TBody' &amp;&amp; elem != 'TFoot' &amp;&amp; elem != 'Caption').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETR" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="4"/>
            <description>TR element should be contained in Table, THead, TBody or TFoot element</description>
            <test>/^(Table|THead|TBody|TFoot)$/.test(parentStandardType)</test>
            <error>
                <message>TR element contained in %1 instead of Table, THead, TBody or TFoot element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETHead" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="5"/>
            <description>THead element should be contained in Table element</description>
            <test>parentStandardType == 'Table'</test>
            <error>
                <message>THead element contained in %1 instead of Table element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETBody" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="6"/>
            <description>TBody element should be contained in Table element</description>
            <test>parentStandardType == 'Table'</test>
            <error>
                <message>TBody element contained in %1 instead of Table element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETFoot" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="7"/>
            <description>TFoot element should be contained in Table element</description>
            <test>parentStandardType == 'Table'</test>
            <error>
                <message>TFoot element contained in %1 instead of Table element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETH" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="8"/>
            <description>TH element should be contained in TR element</description>
            <test>parentStandardType == 'TR'</test>
            <error>
                <message>TH element contained in %1 instead of TR element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETD" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="9"/>
            <description>TD element should be contained in TR element</description>
            <test>parentStandardType == 'TR'</test>
            <error>
                <message>TD element contained in %1 instead of TR element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETR" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="10"/>
            <description>TR element may contain only TH and TD elements</description>
            <test>/^(TH|TD)(&amp;(TH|TD))*$/.test(kidsStandardTypes) || kidsStandardTypes == ''</test>
            <error>
                <message>TR element contains %1 element(s) instead of TH or TD</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TD' &amp;&amp; elem != 'TH').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="11"/>
            <description>Table element should contain zero or one THead kid</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'THead').length &lt;= 1</test>
            <error>
                <message>Table element contains more than one THead kid</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="12"/>
            <description>Table element should contain zero or one TFoot kid</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'TFoot').length &lt;= 1</test>
            <error>
                <message>Table element contains more than one TFoot kid</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="13"/>
            <description>If Table element contains TFoot kid, Table element should contain one or more TBody kids</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'TFoot').length == 0 || kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'TBody').length &gt; 0</test>
            <error>
                <message>Table element contains TFoot kid, but does not contain TBody kids</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="14"/>
            <description>If Table element contains THead kid, Table element should contain one or more TBody kids</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'THead').length == 0 || kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'TBody').length &gt; 0</test>
            <error>
                <message>Table element contains THead kid, but does not contain TBody kids</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETableCell" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="15"/>
            <description>A table cell shall not have intersection with other cells</description>
            <test>hasIntersection != true</test>
            <error>
                <message>Table cell has intersection with other cells</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="16"/>
            <description>Table element may contain a Caption element as its first or last kid</description>
            <test>kidsStandardTypes.indexOf('&amp;Caption&amp;') &lt; 0</test>
            <error>
                <message>Table element contains Caption as its %1 child instead of first or last one</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').slice(1).findIndex(elem =&gt; elem == 'Caption') + 2</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SELI" tags="structure,list">
            <id specification="ISO_14289_1" clause="7.2" testNumber="17"/>
            <description>LI element should be contained in L element</description>
            <test>parentStandardType == 'L'</test>
            <error>
                <message>LI element contained in %1 instead of L element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.3"/>
            </references>
        </rule>
        <rule object="SELBody" tags="structure,list">
            <id specification="ISO_14289_1" clause="7.2" testNumber="18"/>
            <description>LBody element should be contained in LI element</description>
            <test>parentStandardType == 'LI'</test>
            <error>
                <message>LBody element contained in %1 instead of LI element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.3"/>
            </references>
        </rule>
        <rule object="SEL" tags="structure,list">
            <id specification="ISO_14289_1" clause="7.2" testNumber="19"/>
            <description>L element may contain only L, LI and Caption elements</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'L' &amp;&amp; elem != 'LI' &amp;&amp; elem != 'Caption').length == 0 || kidsStandardTypes == ''</test>
            <error>
                <message>L element contains %1 element(s) instead of L, LI or Caption</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'L' &amp;&amp; elem != 'LI'
                        &amp;&amp; elem != 'Caption').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.3"/>
            </references>
        </rule>
        <rule object="SELI" tags="structure,list">
            <id specification="ISO_14289_1" clause="7.2" testNumber="20"/>
            <description>LI element may contain only Lbl and LBody elements</description>
            <test>/^(Lbl|LBody)(&amp;(Lbl|LBody))*$/.test(kidsStandardTypes) || kidsStandardTypes == ''</test>
            <error>
                <message>LI element contains %1 element(s) instead of Lbl or LBody</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'LBody' &amp;&amp; elem != 'Lbl').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.3"/>
            </references>
        </rule>
        <rule object="PDStructElem" tags="structure,lang">
            <id specification="ISO_14289_1" clause="7.2" testNumber="21"/>
            <description>Natural language for text in ActualText attribute shall be determined</description>
            <test>ActualText == null || containsLang == true || parentLang != null || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language for text in ActualText attribute cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDStructElem" tags="structure,lang">
            <id specification="ISO_14289_1" clause="7.2" testNumber="22"/>
            <description>Natural language for text in Alt attribute shall be determined</description>
            <test>Alt == null || containsLang == true || parentLang != null || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language for text in Alt attribute cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDStructElem" tags="structure,lang">
            <id specification="ISO_14289_1" clause="7.2" testNumber="23"/>
            <description>Natural language for text in E attribute shall be determined</description>
            <test>E == null || containsLang == true || parentLang != null || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language for text in E attribute cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot" tags="lang,annotation,structure">
            <id specification="ISO_14289_1" clause="7.2" testNumber="24"/>
            <description>Natural language in the Contents entry for annotations shall be determined</description>
            <test>Contents == null || containsLang == true || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language in the Contents entry for annotations cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDFormField" tags="structure,lang">
            <id specification="ISO_14289_1" clause="7.2" testNumber="25"/>
            <description>Natural language in the TU key for form fields shall be determined</description>
            <test>TU == null || containsLang == true || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language in the TU key for form fields cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SETOCI" tags="structure,toc">
            <id specification="ISO_14289_1" clause="7.2" testNumber="26"/>
            <description>TOCI element should be contained in TOC element</description>
            <test>parentStandardType == 'TOC'</test>
            <error>
                <message>TOCI element contained in %1 instead of TOC element</message>
                <arguments>
                    <argument>parentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.2"/>
            </references>
        </rule>
        <rule object="SETOC" tags="structure,toc">
            <id specification="ISO_14289_1" clause="7.2" testNumber="27"/>
            <description>TOC element may contain only TOC, TOCI and Caption elements</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TOC' &amp;&amp; elem != 'TOCI' &amp;&amp; elem != 'Caption').length == 0 || kidsStandardTypes == ''</test>
            <error>
                <message>TOC element contains %1 element(s) instead of TOC, TOCI or Caption</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TOC' &amp;&amp; elem != 'TOCI'
                        &amp;&amp; elem != 'Caption').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.2"/>
            </references>
        </rule>
        <rule object="SETOC" tags="structure,toc">
            <id specification="ISO_14289_1" clause="7.2" testNumber="28"/>
            <description>TOC element may contain a Caption element only as its first kid</description>
            <test>kidsStandardTypes == '' || kidsStandardTypes.split('&amp;').slice(1).findIndex(elem =&gt; elem == 'Caption') &lt; 0</test>
            <error>
                <message>TOC element contains Caption as its %1 child instead of first one</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').slice(1).findIndex(elem =&gt; elem == 'Caption') + 2</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.2"/>
            </references>
        </rule>
        <rule object="CosLang" tags="lang">
            <id specification="ISO_14289_1" clause="7.2" testNumber="29"/>
            <description>If the Lang entry is present in the document's Catalog dictionary or in a structure element dictionary or property list, its value shall be a language identifier as described in ISO 32000-1:2008, 14.9.2. A language identifier shall be a Language-Tag as defined in RFC 3066, Tags for the Identification of Languages</description>
            <test>/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/.test(unicodeValue)</test>
            <error>
                <message>Value %1 of the Lang entry is not a Language-Tag</message>
                <arguments>
                    <argument>unicodeValue</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.9.2"/>
                <reference specification="RFC 3066" clause="2.1"/>
            </references>
        </rule>
        <rule object="SEMarkedContent" tags="lang,alt-text">
            <id specification="ISO_14289_1" clause="7.2" testNumber="30"/>
            <description>Natural language for text in ActualText attribute in Span Marked Content shall be determined</description>
            <test>tag != 'Span' || ActualText == null || Lang != null || inheritedLang != null || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language for text in ActualText attribute in Span Marked Content cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SEMarkedContent" tags="lang,alt-text">
            <id specification="ISO_14289_1" clause="7.2" testNumber="31"/>
            <description>Natural language for text in Alt attribute in Span Marked Content shall be determined</description>
            <test>tag != 'Span' || Alt == null || Lang != null || inheritedLang != null || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language for text in Alt attribute in Span Marked Content cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SEMarkedContent" tags="lang,alt-text">
            <id specification="ISO_14289_1" clause="7.2" testNumber="32"/>
            <description>Natural language for text in E attribute in Span Marked Content shall be determined</description>
            <test>tag != 'Span' || E == null || Lang != null || inheritedLang != null || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language for text in E attribute in Span Marked Content cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="XMPLangAlt" deferred="true" tags="lang,metadata">
            <id specification="ISO_14289_1" clause="7.2" testNumber="33"/>
            <description>Natural language for document metadata shall be determined</description>
            <test>xDefault == false || gContainsCatalogLang == true</test>
            <error>
                <message>Natural language for document metadata cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SETextItem" tags="lang,text">
            <id specification="ISO_14289_1" clause="7.2" testNumber="34"/>
            <description>Natural language for text in page content shall be determined</description>
            <test>gContainsCatalogLang == true || Lang != null</test>
            <error>
                <message>Natural language for text in page content cannot be determined</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SETHead" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="36"/>
            <description>THead element may contain only TR elements</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TR').length == 0 || kidsStandardTypes == ''</test>
            <error>
                <message>THead element contains %1 element(s) instead of TR</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TR').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETBody" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="37"/>
            <description>TBody element may contain only TR elements</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TR').length == 0 || kidsStandardTypes == ''</test>
            <error>
                <message>TBody element contains %1 element(s) instead of TR</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TR').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETFoot" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="38"/>
            <description>TFoot element may contain only TR elements</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TR').length == 0 || kidsStandardTypes == ''</test>
            <error>
                <message>TFoot element contains %1 element(s) instead of TR</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem != 'TR').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="39"/>
            <description>Table element may contain only one Caption element</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'Caption').length &lt; 2</test>
            <error>
                <message>Table element contains %1 Caption elements instead of one</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'Caption').length</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SEL" tags="structure,list">
            <id specification="ISO_14289_1" clause="7.2" testNumber="40"/>
            <description>L element may contain a Caption element only as its first kid</description>
            <test>kidsStandardTypes == '' || kidsStandardTypes.split('&amp;').slice(1).findIndex(elem =&gt; elem == 'Caption') &lt; 0</test>
            <error>
                <message>L element contains Caption as its %1 child instead of first one</message>
                <arguments>
                    <argument>kidsStandardTypes.split('&amp;').slice(1).findIndex(elem =&gt; elem == 'Caption') + 2</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.2"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="41"/>
            <description>Table columns shall have the same number of rows (taking into account row spans)</description>
            <test>numberOfColumnWithWrongRowSpan == null</test>
            <error>
                <message>Table columns 1 and %1 span different number of rows</message>
                <arguments>
                    <argument>numberOfColumnWithWrongRowSpan + 1</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="42"/>
            <description>Table rows shall have the same number of columns (taking into account column spans)</description>
            <test>numberOfRowWithWrongColumnSpan == null || wrongColumnSpan != null</test>
            <error>
                <message>Table rows 1 and %1 span different number of columns</message>
                <arguments>
                    <argument>numberOfRowWithWrongColumnSpan + 1</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SETable" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.2" testNumber="43"/>
            <description>Table rows shall have the same number of columns (taking into account column spans)</description>
            <test>numberOfRowWithWrongColumnSpan == null || wrongColumnSpan == null</test>
            <error>
                <message>Table rows 1 and %1 span different number of columns (%2 and %3 respectively)</message>
                <arguments>
                    <argument>numberOfRowWithWrongColumnSpan + 1</argument>
                    <argument>columnSpan</argument>
                    <argument>wrongColumnSpan</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.4"/>
            </references>
        </rule>
        <rule object="SEFigure" tags="alt-text,structure,figure">
            <id specification="ISO_14289_1" clause="7.3" testNumber="1"/>
            <description>Figure tags shall include an alternative representation or replacement text that represents the contents marked with the Figure tag as noted in ISO 32000-1:2008, 14.7.2, Table 323</description>
            <test>(Alt != null &amp;&amp; Alt != '') || ActualText != null</test>
            <error>
                <message>Figure structure element neither has an alternate description nor a replacement text</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.7.2"/>
            </references>
        </rule>
        <rule object="SEHn" tags="structure,heading">
            <id specification="ISO_14289_1" clause="7.4.2" testNumber="1"/>
            <description>For documents that are not strongly structured, as described in ISO 32000-1:2008, 14.8.4.3.5, heading tags shall be used as follows: (*) If any heading tags are used, H1 shall be the first. (*) A document may use more than one instance of any specific tag level. For example, a tag level may be repeated if document content requires it. (*) If document semantics require a descending sequence of headers, such a sequence shall proceed in strict numerical order and shall not skip an intervening heading level. (*) A document may increment its heading sequence without restarting at H1 if document semantics require it</description>
            <test>hasCorrectNestingLevel == true</test>
            <error>
                <message>Heading level %1 is skipped in a descending sequence of header levels</message>
                <arguments>
                    <argument>nestingLevel - 1</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.3.5"/>
            </references>
        </rule>
        <rule object="PDStructElem" tags="structure,heading">
            <id specification="ISO_14289_1" clause="7.4.4" testNumber="1"/>
            <description>Each node in the tag tree shall contain at most one child H tag</description>
            <test>kidsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'H').length &lt;= 1</test>
            <error>
                <message>A node contains more than one H tag</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SEH" deferred="true" tags="structure,heading">
            <id specification="ISO_14289_1" clause="7.4.4" testNumber="2"/>
            <description>All documents shall be either strongly or weakly structured, but not both</description>
            <test>usesHn == false</test>
            <error>
                <message>Document uses both H and H# tags</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SEHn" deferred="true" tags="structure,heading">
            <id specification="ISO_14289_1" clause="7.4.4" testNumber="3"/>
            <description>All documents shall be either strongly or weakly structured, but not both</description>
            <test>usesH == false</test>
            <error>
                <message>Document uses both H and H# tags</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SETD" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.5" testNumber="1"/>
            <description>If the table's structure is not determinable via Headers and IDs, then structure elements of type TH shall have a Scope attribute</description>
            <test>hasConnectedHeader != false || unknownHeaders != ''</test>
            <error>
                <message>TD does not contain Headers attribute, and Headers for this table cell cannot be determined algorithmically</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-2:2020" clause="14.8.4.8.3"/>
            </references>
        </rule>
        <rule object="SETD" tags="structure,table">
            <id specification="ISO_14289_1" clause="7.5" testNumber="2"/>
            <description>If the table's structure is not determinable via Headers and IDs, then structure elements of type TH shall have a Scope attribute</description>
            <test>hasConnectedHeader != false || unknownHeaders == ''</test>
            <error>
                <message>TD references undefined Header(s) %1, and Headers for this table cell cannot be determined algorithmically</message>
                <arguments>
                    <argument>unknownHeaders</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-2:2020" clause="14.8.4.8.3"/>
            </references>
        </rule>
        <rule object="SEFormula" tags="structure,alt-text">
            <id specification="ISO_14289_1" clause="7.7" testNumber="1"/>
            <description>All mathematical expressions shall be enclosed within a Formula tag as detailed in ISO 32000-1:2008, 14.8.4.5 and shall have Alt or ActualText attributes</description>
            <test>(Alt != null &amp;&amp; Alt != '') || ActualText != null</test>
            <error>
                <message>Formula structure element neither has an alternate description nor a replacement text</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.5"/>
            </references>
        </rule>
        <rule object="SENote" tags="structure,note">
            <id specification="ISO_14289_1" clause="7.9" testNumber="1"/>
            <description>Note tag shall have ID entry</description>
            <test>noteID != null &amp;&amp; noteID != ''</test>
            <error>
                <message>ID key of the Note tag is not present</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="SENote" tags="structure,note">
            <id specification="ISO_14289_1" clause="7.9" testNumber="2"/>
            <description>Each Note tag shall have unique ID key</description>
            <test>hasDuplicateNoteID == false</test>
            <error>
                <message>ID key %1 of the Note tag is non-unique</message>
                <arguments>
                    <argument>noteID</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDOCConfig" tags="syntax">
            <id specification="ISO_14289_1" clause="7.10" testNumber="1"/>
            <description>Each optional content configuration dictionary that forms the value of the D key, or that is an element in the array that forms the value of the Configs key in the OCProperties dictionary, shall contain the Name key</description>
            <test>Name != null &amp;&amp; Name.length() &gt; 0</test>
            <error>
                <message>Missing or empty Name entry of the optional content configuration dictionary</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDOCConfig" tags="syntax">
            <id specification="ISO_14289_1" clause="7.10" testNumber="2"/>
            <description>The AS key shall not appear in any optional content configuration dictionary</description>
            <test>AS == null</test>
            <error>
                <message>AS key is present in the optional content configuration dictionary</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosFileSpecification" tags="syntax">
            <id specification="ISO_14289_1" clause="7.11" testNumber="1"/>
            <description>The file specification dictionary for an embedded file shall contain the non-empty F and UF keys</description>
            <test>containsEF == false || (F != null &amp;&amp; F != '' &amp;&amp; UF != null &amp;&amp; UF != '')</test>
            <error>
                <message>The file specification dictionary for an embedded file does not contain either F or UF key or at least one of the keys is empty (F = %1, UF = %2)</message>
                <arguments>
                    <argument>F</argument>
                    <argument>UF</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAcroForm" tags="syntax">
            <id specification="ISO_14289_1" clause="7.15" testNumber="1"/>
            <description>Dynamic XFA forms shall not be used</description>
            <test>dynamicRender != 'required'</test>
            <error>
                <message>Dynamic XFA forms is present</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDEncryption" tags="syntax">
            <id specification="ISO_14289_1" clause="7.16" testNumber="1"/>
            <description>An encrypted conforming file shall contain a P key in its encryption dictionary (ISO 32000-1:2008, 7.6.3.2, Table 21). The 10th bit position of the P key shall be true</description>
            <test>P != null &amp;&amp; (P &amp; 512) == 512</test>
            <error>
                <message>The file is encrypted but does not contain a P entry in its encryption dictionary or the file is encrypted and does contain a P entry, but the 10th bit position of the P entry is false (P = %1, 10th bit = %2)</message>
                <arguments>
                    <argument>P</argument>
                    <argument>P != null ? (P &amp; 512) &gt;&gt; 9 : null</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="7.6.3.2"/>
            </references>
        </rule>
        <rule object="PDAnnot" tags="annotation">
            <id specification="ISO_14289_1" clause="7.18.1" testNumber="1"/>
            <description>An annotation, excluding annotations of subtype Widget, PrinterMark or Link, shall be nested within an Annot tag</description>
            <test>Subtype == 'Widget' || Subtype == 'PrinterMark' || Subtype == 'Link' || isOutsideCropBox == true || (F &amp; 2) == 2 || structParentStandardType == 'Annot'</test>
            <error>
                <message>%1 annotation is an Artifact or is nested within %2 tag (standard type = %3) instead of Annot</message>
                <arguments>
                    <argument>Subtype</argument>
                    <argument>structParentType</argument>
                    <argument>structParentStandardType</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot" tags="annotation,alt-text">
            <id specification="ISO_14289_1" clause="7.18.1" testNumber="2"/>
            <description>An annotation (except Widget annotations or hidden annotations, or those having rectangle outside the crop-box) shall have either Contents key or an Alt entry in the enclosing structure element</description>
            <test>Subtype == 'Widget' || isOutsideCropBox == true || (F &amp; 2) == 2 || (Contents != null &amp;&amp; Contents != '') || (Alt != null &amp;&amp; Alt != '')</test>
            <error>
                <message>%1 annotation whose hidden flag is not set and whose rectangle is not outside the crop-box has neither Contents key nor an Alt entry in the enclosing structure element</message>
                <arguments>
                    <argument>Subtype</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDWidgetAnnot" tags="annotation,alt-text">
            <id specification="ISO_14289_1" clause="7.18.1" testNumber="3"/>
            <description>A form field shall have a TU key present or all its Widget annotations shall have alternative descriptions (in the form of an Alt entry in the enclosing structure elements)</description>
            <test>isOutsideCropBox == true || (F &amp; 2) == 2 || (TU != null &amp;&amp; TU != '') || (Alt != null &amp;&amp; Alt != '')</test>
            <error>
                <message>A form field neither has TU key nor its Widget annotations have alternative descriptions (in the form of an Alt entry in the enclosing structure element)</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDTrapNetAnnot" tags="annotation">
            <id specification="ISO_14289_1" clause="7.18.2" testNumber="1"/>
            <description>Annotations of subtype TrapNet shall not be permitted</description>
            <test>isOutsideCropBox == true || (F &amp; 2) == 2</test>
            <error>
                <message>An annotation of subtype TrapNet exists</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDPage" tags="page">
            <id specification="ISO_14289_1" clause="7.18.3" testNumber="1"/>
            <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>
            <test>containsAnnotations == false || Tabs == 'S'</test>
            <error>
                <message>A page with annotation(s) contains Tabs key with value %1 instead of S</message>
                <arguments>
                    <argument>Tabs</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDWidgetAnnot" tags="annotation">
            <id specification="ISO_14289_1" clause="7.18.4" testNumber="1"/>
            <description>A Widget annotation shall be nested within a Form tag per ISO 32000-1:2008, 14.8.4.5, Table 340</description>
            <test>structParentStandardType == 'Form' || isOutsideCropBox == true || (F &amp; 2) == 2</test>
            <error>
                <message>A Widget annotation is an Artifact or is nested within %1 tag (standard type = %2) instead of Form</message>
                <arguments>
                    <argument>structParentType</argument>
                    <argument>structParentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.5"/>
            </references>
        </rule>
        <rule object="SEForm" tags="structure">
            <id specification="ISO_14289_1" clause="7.18.4" testNumber="2"/>
            <description>If the Form element omits a Role attribute (Table 348), it shall have only one child: an object reference (14.7.4.3) identifying the widget annotation per ISO 32000-1:2008, 14.8.4.5, Table 340</description>
            <test>roleAttribute != null || hasOneInteractiveChild == true</test>
            <error>
                <message>The Form element omits a Role attribute and doesn't have only one child identifying the widget annotation</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.5"/>
            </references>
        </rule>
        <rule object="PDLinkAnnot" tags="annotation">
            <id specification="ISO_14289_1" clause="7.18.5" testNumber="1"/>
            <description>Links shall be tagged according to ISO 32000-1:2008, 14.8.4.4.2, Link Element</description>
            <test>structParentStandardType == 'Link' || isOutsideCropBox == true || (F &amp; 2) == 2</test>
            <error>
                <message>A Link annotation is an Artifact or is nested within %1 tag (standard type = %2) instead of Link</message>
                <arguments>
                    <argument>structParentType</argument>
                    <argument>structParentStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4.4.2"/>
            </references>
        </rule>
        <rule object="PDLinkAnnot" tags="structure,annotation,alt-text">
            <id specification="ISO_14289_1" clause="7.18.5" testNumber="2"/>
            <description>Links shall contain an alternate description via their Contents key as described in ISO 32000-1:2008, 14.9.3</description>
            <test>(Contents != null &amp;&amp; Contents != '') || isOutsideCropBox == true || (F &amp; 2) == 2</test>
            <error>
                <message>A link annotation does not include an alternate description in the Contents key</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.9.3"/>
            </references>
        </rule>
        <rule object="PDMediaClip" tags="syntax">
            <id specification="ISO_14289_1" clause="7.18.6.2" testNumber="1"/>
            <description>In the media clip data dictionary, the optional CT key (ISO 32000-1:2008, 13.2.4.2, Table 274) is required</description>
            <test>CT != null</test>
            <error>
                <message>CT key is missing from the media clip data dictionary</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="13.2.4.2"/>
            </references>
        </rule>
        <rule object="PDMediaClip" tags="alt-text">
            <id specification="ISO_14289_1" clause="7.18.6.2" testNumber="2"/>
            <description>In the media clip data dictionary, the optional Alt key (ISO 32000-1:2008, 13.2.4.2, Table 274) is required</description>
            <test>hasCorrectAlt == true</test>
            <error>
                <message>Alt key (value %1) is missing from the media clip data dictionary or has incorrect value</message>
                <arguments>
                    <argument>Alt</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="13.2.4.2"/>
            </references>
        </rule>
        <rule object="PDPrinterMarkAnnot" tags="annotation">
            <id specification="ISO_14289_1" clause="7.18.8" testNumber="1"/>
            <description>PrinterMark annotations, if present, shall be considered Incidental Artifacts, as if they are hidden page elements as defined in ISO 32000-1:2008, 14.8.2.2.3</description>
            <test>structParentType == null || isOutsideCropBox == true || (F &amp; 2) == 2</test>
            <error>
                <message>A PrinterMark annotation is included in logical structure</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.2.2.3"/>
            </references>
        </rule>
        <rule object="PDXForm" tags="syntax">
            <id specification="ISO_14289_1" clause="7.20" testNumber="1"/>
            <description>A conforming file shall not contain any reference XObjects</description>
            <test>containsRef == false</test>
            <error>
                <message>The document contains a reference XObject (Ref key in the form XObject dictionary)</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXForm" tags="syntax">
            <id specification="ISO_14289_1" clause="7.20" testNumber="2"/>
            <description>The content of Form XObjects shall be incorporated into structure elements according to ISO 32000-1:2008, 14.7.2</description>
            <test>isUniqueSemanticParent == true</test>
            <error>
                <message>Form XObject contains MCIDs and is referenced more than once</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.7.2"/>
            </references>
        </rule>
        <rule object="PDType0Font" tags="font">
            <id specification="ISO_14289_1" clause="7.21.3.1" testNumber="1"/>
            <description>For any given composite (Type 0) font within a conforming file, the CIDSystemInfo entry in its CIDFont dictionary and its Encoding dictionary shall have the following relationship: - If the Encoding key in the Type 0 font dictionary is Identity-H or Identity-V, any values of Registry, Ordering, and Supplement may be used in the CIDSystemInfo entry of the CIDFont. - Otherwise, the corresponding Registry and Ordering strings in both CIDSystemInfo dictionaries shall be identical, and the value of the Supplement key in the CIDSystemInfo dictionary of the CIDFont shall be less than or equal to the Supplement key in the CIDSystemInfo dictionary of the CMap</description>
            <test>cmapName == "Identity-H" || cmapName == "Identity-V" || (CIDFontOrdering != null &amp;&amp; CIDFontOrdering == CMapOrdering &amp;&amp; CIDFontRegistry != null &amp;&amp; CIDFontRegistry == CMapRegistry &amp;&amp; CIDFontSupplement != null &amp;&amp; CMapSupplement != null &amp;&amp; CIDFontSupplement &lt;= CMapSupplement)</test>
            <error>
                <message>CIDSystemInfo entries the CIDFont and CMap dictionaries of a Type 0 font are not compatible (CIDSystemInfo Ordering = %1, CMap Ordering = %2, CIDSystemInfo Registry = %3, CMap Registry = %4, CIDSystemInfo Supplement = %5, CMap Supplement = %6)</message>
                <arguments>
                    <argument>CIDFontOrdering</argument>
                    <argument>CMapOrdering</argument>
                    <argument>CIDFontRegistry</argument>
                    <argument>CMapRegistry</argument>
                    <argument>CIDFontSupplement</argument>
                    <argument>CMapSupplement</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDCIDFont" tags="font">
            <id specification="ISO_14289_1" clause="7.21.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 || containsFontFile == false</test>
            <error>
                <message>A Type 2 CIDFont dictionary has missing or invalid CIDToGIDMap entry</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.7.4, Table 117"/>
            </references>
        </rule>
        <rule object="PDCMap" tags="font">
            <id specification="ISO_14289_1" clause="7.21.3.3" testNumber="1"/>
            <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>
            <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-UTF16-H" || CMapName == "UniGB-UTF16-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-UTF16-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>
                    <argument>CMapName</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.7.5.2, Table 118"/>
            </references>
        </rule>
        <rule object="CMapFile" tags="font">
            <id specification="ISO_14289_1" clause="7.21.3.3" testNumber="2"/>
            <description>For those CMaps that are embedded, the integer value of the WMode entry in the CMap dictionary shall be identical to the WMode value in the embedded CMap stream</description>
            <test>WMode == dictWMode</test>
            <error>
                <message>WMode entry (value %1) in the embedded CMap and in the CMap dictionary (value %2) are not identical</message>
                <arguments>
                    <argument>WMode</argument>
                    <argument>dictWMode</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDReferencedCMap" tags="font">
            <id specification="ISO_14289_1" clause="7.21.3.3" testNumber="3"/>
            <description>A CMap shall not reference any other CMap except those listed in ISO 32000-1:2008, 9.7.5.2, Table 118</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-UTF16-H" || CMapName == "UniGB-UTF16-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-UTF16-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"</test>
            <error>
                <message>A CMap references another non-standard CMap %1</message>
                <arguments>
                    <argument>CMapName</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.7.5.2, Table 118"/>
            </references>
        </rule>
        <rule object="PDFont" tags="font">
            <id specification="ISO_14289_1" clause="7.21.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 || containsFontFile == true</test>
            <error>
                <message>The font program is not embedded</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.9"/>
            </references>
        </rule>
        <rule object="Glyph" tags="font">
            <id specification="ISO_14289_1" clause="7.21.4.1" testNumber="2"/>
            <description>Embedded fonts shall define all glyphs referenced for rendering within the conforming file. A font referenced solely in text rendering mode 3 is not rendered and is thus exempt from the requirements that impact the visual representation of the glyphs of a font. In all cases for TrueType fonts that are to be rendered, character codes shall be able to be mapped to glyphs according to ISO 32000-1:2008, 9.6.6.4 without the use of a non-standard mapping chosen by the conforming processor</description>
            <test>renderingMode == 3 || isGlyphPresent == null || isGlyphPresent == true</test>
            <error>
                <message>Not all glyphs referenced for rendering are present in the embedded font program</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.3.6"/>
                <reference specification="ISO 32000-1:2008" clause="9.6.6.4"/>
            </references>
        </rule>
        <rule object="PDType1Font" tags="font">
            <id specification="ISO_14289_1" clause="7.21.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>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/>
            </error>
            <references/>
        </rule>
        <rule object="PDCIDFont" tags="font">
            <id specification="ISO_14289_1" clause="7.21.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>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/>
            </error>
            <references/>
        </rule>
        <rule object="Glyph" tags="font">
            <id specification="ISO_14289_1" clause="7.21.5" testNumber="1"/>
            <description>For every font embedded in a conforming file and used for rendering, the glyph width information in the font dictionary and in the embedded font program shall be consistent</description>
            <test>renderingMode == 3 || widthFromFontProgram == null || widthFromDictionary == null || Math.abs(widthFromFontProgram - widthFromDictionary) &lt;= 1</test>
            <error>
                <message>Glyph width %1 in the embedded font program is not consistent with the Widths entry of the font dictionary (value %2)</message>
                <arguments>
                    <argument>widthFromFontProgram</argument>
                    <argument>widthFromDictionary</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="TrueTypeFontProgram" tags="font">
            <id specification="ISO_14289_1" clause="7.21.6" testNumber="1"/>
            <description>For all non-symbolic TrueType fonts used for rendering, the embedded TrueType font program shall contain one or several non-symbolic cmap entries such that all necessary glyph lookups can be carried out</description>
            <test>isSymbolic == true || (cmap30Present == true ? nrCmaps &gt; 1 : nrCmaps &gt; 0)</test>
            <error>
                <message>The embedded font program for a non-symbolic TrueType font does not contain non-symbolic cmap entries</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDTrueTypeFont" tags="font">
            <id specification="ISO_14289_1" clause="7.21.6" testNumber="2"/>
            <description>All non-symbolic TrueType fonts shall have either MacRomanEncoding or WinAnsiEncoding as the value for the Encoding key in the Font dictionary or as the value for the BaseEncoding key in the dictionary which is the value of the Encoding key in the Font dictionary. In addition, no non-symbolic TrueType font shall define a Differences array unless all of the glyph names in the Differences array are listed in the Adobe Glyph List and, if the font program is embedded, it shall contain at least the Microsoft Unicode (3,1 – Platform ID = 3, Encoding ID = 1) encoding in the 'cmap' table</description>
            <test>isSymbolic == true || ((Encoding == "MacRomanEncoding" || Encoding == "WinAnsiEncoding") &amp;&amp; (containsDifferences == false || differencesAreUnicodeCompliant == true))</test>
            <error>
                <message>A non-symbolic TrueType font encoding does not define a correct mapping to the Adobe Glyph List (Encoding = %1, Encoding entry contains a Differences = %2, Differences are Unicode compliant = %3)</message>
                <arguments>
                    <argument>Encoding</argument>
                    <argument>containsDifferences</argument>
                    <argument>differencesAreUnicodeCompliant</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDTrueTypeFont" tags="font">
            <id specification="ISO_14289_1" clause="7.21.6" testNumber="3"/>
            <description>Symbolic TrueType fonts shall not contain an Encoding entry in the font dictionary</description>
            <test>isSymbolic == false || Encoding == null</test>
            <error>
                <message>A symbolic TrueType font specifies an Encoding entry in its dictionary</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="TrueTypeFontProgram" tags="font">
            <id specification="ISO_14289_1" clause="7.21.6" testNumber="4"/>
            <description>The 'cmap' table in the embedded font program for a symbolic TrueType font shall contain either exactly one encoding or it shall contain, at least, the Microsoft Symbol (3,0 - Platform ID=3, Encoding ID=0) encoding</description>
            <test>isSymbolic == false || nrCmaps == 1 || cmap30Present == true</test>
            <error>
                <message>The embedded font program for a symbolic TrueType font contains %1 cmap subtables and does not contain Microsoft Symbol (3,0 – Platform ID=3, Encoding ID=0)</message>
                <arguments>
                    <argument>nrCmaps</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="Glyph" tags="font">
            <id specification="ISO_14289_1" clause="7.21.7" testNumber="1"/>
            <description>The Font dictionary of all fonts shall define the map of all used character codes to Unicode values, either via a ToUnicode entry, or other mechanisms as defined in ISO 14289-1, 7.21.7</description>
            <test>toUnicode != null</test>
            <error>
                <message>The glyph can not be mapped to Unicode</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 14289-1:2014" clause="7.21.7"/>
            </references>
        </rule>
        <rule object="Glyph" tags="font">
            <id specification="ISO_14289_1" clause="7.21.7" testNumber="2"/>
            <description>The Unicode values specified in the ToUnicode CMap shall all be greater than zero (0), but not equal to either U+FEFF or U+FFFE</description>
            <test>toUnicode == null || (toUnicode.indexOf("\u0000") == -1 &amp;&amp; toUnicode.indexOf("\uFFFE") == -1 &amp;&amp; toUnicode.indexOf("\uFEFF") == -1)</test>
            <error>
                <message>The glyph has Unicode value 0, U+FEFF or U+FFFE, which is invalid by Unicode standard</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="Glyph" tags="font">
            <id specification="ISO_14289_1" clause="7.21.8" testNumber="1"/>
            <description>A PDF/UA compliant document shall not contain a reference to the .notdef glyph from any of the text showing operators, regardless of text rendering mode, in any content stream</description>
            <test>name != ".notdef"</test>
            <error>
                <message>The document contains a reference to the .notdef glyph</message>
                <arguments/>
            </error>
            <references/>
        </rule>
    </rules>
    <variables>
        <variable name="gContainsCatalogLang" object="PDDocument">
            <defaultValue>false</defaultValue>
            <value>containsLang</value>
        </variable>
        <variable name="usesH" object="SEH">
            <defaultValue>false</defaultValue>
            <value>true</value>
        </variable>
        <variable name="usesHn" object="SEHn">
            <defaultValue>false</defaultValue>
            <value>true</value>
        </variable>
    </variables>
</profile>