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
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="PDFA_2_A">
    <details creator="veraPDF Consortium" created="2017-08-25T07:58:39.172Z">
        <name>PDF/A-2a validation profile</name>
        <description>Validation rules against ISO 19005-2:2011, Level A</description>
    </details>
    <hash></hash>
    <rules>
        <rule object="CosDocument">
            <id specification="ISO_19005_2" clause="6.1.2" testNumber="1"/>
            <description>The file header shall begin at byte zero and 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>headerOffset == 0 &amp;&amp; /^%PDF-1\.[0-7]$/.test(header)</test>
            <error>
                <message>File header %1 (offset = %2) starts at non-zero offset or does not match the pattern %PDF-1.n, where 'n' is a single digit number between 0 and 7</message>
                <arguments>
                    <argument>header</argument>
                    <argument>headerOffset</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_2" clause="6.1.2" testNumber="2"/>
            <description>The aforementioned EOL marker shall be immediately followed by a % (25h) character followed by at least four bytes, each of whose encoded byte values shall have a decimal value greater than 127</description>
            <test>headerByte1 &gt; 127 &amp;&amp; headerByte2 &gt; 127 &amp;&amp; headerByte3 &gt; 127 &amp;&amp; headerByte4 &gt; 127</test>
            <error>
                <message>Binary comment in the file header is missing or does not start with 4 bytes with byte values above 127 (first four bytes = %1, %2, %3, %4)</message>
                <arguments>
                    <argument>headerByte1</argument>
                    <argument>headerByte2</argument>
                    <argument>headerByte3</argument>
                    <argument>headerByte4</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_2" clause="6.1.3" testNumber="1"/>
            <description>The file trailer dictionary shall contain the ID keyword whose value shall be File Identifiers as defined in ISO 32000-1:2008, 14.4</description>
            <test>lastID != null &amp;&amp; lastID.length() &gt; 0</test>
            <error>
                <message>Missing or empty ID in the document trailer</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.4"/>
            </references>
        </rule>
        <rule object="CosTrailer">
            <id specification="ISO_19005_2" clause="6.1.3" testNumber="2"/>
            <description>The keyword Encrypt shall not be used in the trailer dictionary</description>
            <test>isEncrypted != true</test>
            <error>
                <message>Encrypt keyword is present in the trailer dictionary</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_2" clause="6.1.3" testNumber="3"/>
            <description>No data can follow the last end-of-file marker except a single optional end-of-line marker as described in ISO 32000-1:2008, 7.5.5</description>
            <test>postEOFDataSize == 0</test>
            <error>
                <message>%1 byte(s) of data is present after the last end-of-file marker</message>
                <arguments>
                    <argument>postEOFDataSize</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="7.5.5"/>
            </references>
        </rule>
        <rule object="CosXRef">
            <id specification="ISO_19005_2" clause="6.1.4" testNumber="2"/>
            <description>The xref keyword and the cross-reference subsection header shall be separated by a single EOL marker</description>
            <test>xrefEOLMarkersComplyPDFA</test>
            <error>
                <message>Extra spacings or missing EOL characters after the 'xref' keyword in the cross reference table</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosString">
            <id specification="ISO_19005_2" clause="6.1.6" testNumber="1"/>
            <description>Hexadecimal strings shall contain an even number of non-white-space characters</description>
            <test>(isHex != true) || hexCount % 2 == 0</test>
            <error>
                <message>A hexadecimal string contains odd number (%1) of non-white-space characters</message>
                <arguments>
                    <argument>hexCount</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosString">
            <id specification="ISO_19005_2" clause="6.1.6" testNumber="2"/>
            <description>A hexadecimal string is written as a sequence of hexadecimal digits (0–9 and either A–F or a–f)</description>
            <test>(isHex != true) || containsOnlyHex == true</test>
            <error>
                <message>Hexadecimal string contains non-white-space characters outside the range 0 to 9, A to F or a to f</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosStream">
            <id specification="ISO_19005_2" clause="6.1.7.1" testNumber="1"/>
            <description>The value of the Length key specified in the stream dictionary shall match the number of bytes in the file following the LINE FEED (0Ah) character after the stream keyword and preceding the EOL marker before the endstream keyword</description>
            <test>Length == realLength</test>
            <error>
                <message>Actual length of the stream (%1 byte(s)) does not match the value of the Length key in the Stream dictionary (%2 byte(s))</message>
                <arguments>
                    <argument>realLength</argument>
                    <argument>Length</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosStream">
            <id specification="ISO_19005_2" clause="6.1.7.1" testNumber="2"/>
            <description>The stream keyword shall be followed either by a CARRIAGE RETURN (0Dh) and LINE FEED (0Ah) character sequence or by a single LINE FEED (0Ah) character. The endstream keyword shall be preceded by an EOL marker</description>
            <test>streamKeywordCRLFCompliant == true &amp;&amp; endstreamKeywordEOLCompliant == true</test>
            <error>
                <message>Extra spacings or missing EOL characters around keywords 'stream' and 'endstream'</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosStream">
            <id specification="ISO_19005_2" clause="6.1.7.1" testNumber="3"/>
            <description>A stream dictionary shall not contain the F, FFilter, or FDecodeParms keys</description>
            <test>F == null &amp;&amp; FFilter == null &amp;&amp; FDecodeParms == null</test>
            <error>
                <message>A stream object dictionary contains %1 key(s)</message>
                <arguments>
                    <argument>keysString.split('&amp;').filter(elem =&gt; elem == 'F' || elem == 'FFilter' || elem == 'FDecodeParms').toString()</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosFilter">
            <id specification="ISO_19005_2" clause="6.1.7.2" testNumber="1"/>
            <description>All standard stream filters listed in ISO 32000-1:2008, 7.4, Table 6 may be used, with the exception of LZWDecode. In addition, the Crypt filter shall not be used unless the value of the Name key in the decode parameters dictionary is Identity. Filters that are not listed in ISO 32000-1:2008, 7.4, Table 6 shall not be used</description>
            <test> internalRepresentation == "ASCIIHexDecode" || internalRepresentation == "ASCII85Decode" || internalRepresentation == "FlateDecode" || internalRepresentation == "RunLengthDecode" || internalRepresentation == "CCITTFaxDecode" || internalRepresentation == "JBIG2Decode" || internalRepresentation == "DCTDecode" || internalRepresentation == "JPXDecode" || (internalRepresentation == "Crypt" &amp;&amp; decodeParms == "Identity")</test>
            <error>
                <message>Unknown or not permitted Stream filter %1 is used</message>
                <arguments>
                    <argument>internalRepresentation</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosUnicodeName">
            <id specification="ISO_19005_2" clause="6.1.8" testNumber="1"/>
            <description>Font names, names of colourants in Separation and DeviceN colour spaces, and structure type names, after expansion of character sequences escaped with a NUMBER SIGN (23h), if any, shall be valid UTF-8 character sequences</description>
            <test>isValidUtf8 == true</test>
            <error>
                <message>The name value %1 does not represent a correct UTF-8 character sequence</message>
                <arguments>
                    <argument>unicodeValue</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="7.3.5"/>
            </references>
        </rule>
        <rule object="CosIndirect">
            <id specification="ISO_19005_2" clause="6.1.9" testNumber="1"/>
            <description>The object number and generation number shall be separated by a single white-space character. The generation number and obj keyword shall be separated by a single white-space character. The object number and endobj keyword shall each be preceded by an EOL marker. The obj and endobj keywords shall each be followed by an EOL marker</description>
            <test>spacingCompliesPDFA</test>
            <error>
                <message>Extra spacings or missing EOL characters around indirect object/generation number or keywords 'obj' and 'endobj'</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosIIFilter">
            <id specification="ISO_19005_2" clause="6.1.10" testNumber="1"/>
            <description>The value of the F key in the Inline Image dictionary shall not be LZW, LZWDecode, Crypt, a value not listed in ISO 32000-1:2008, Table 6, or an array containing any such value</description>
            <test> internalRepresentation == "ASCIIHexDecode" || internalRepresentation == "ASCII85Decode" || internalRepresentation == "FlateDecode" || internalRepresentation == "RunLengthDecode" || internalRepresentation == "CCITTFaxDecode" || internalRepresentation == "DCTDecode" || internalRepresentation == "AHx" || internalRepresentation == "A85" || internalRepresentation == "Fl" || internalRepresentation == "RL" || internalRepresentation == "CCF" || internalRepresentation == "DCT"</test>
            <error>
                <message>Inline image uses not permitted or unknown filter %1</message>
                <arguments>
                    <argument>internalRepresentation</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDPerms">
            <id specification="ISO_19005_2" clause="6.1.12" testNumber="1"/>
            <description>No keys other than UR3 and DocMDP shall be present in a permissions dictionary (ISO 32000-1:2008, 12.8.4, Table 258)</description>
            <test>entries.split('&amp;').filter(elem =&gt; elem != 'UR3' &amp;&amp; elem != 'DocMDP').length == 0 || entries == ''</test>
            <error>
                <message>The document permissions dictionary contains key(s) %1 other than UR3 and DocMDP</message>
                <arguments>
                    <argument>entries.split('&amp;').filter(elem =&gt; elem != 'UR3' &amp;&amp; elem != 'DocMDP').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="12.8.4"/>
            </references>
        </rule>
        <rule object="PDSigRef">
            <id specification="ISO_19005_2" clause="6.1.12" testNumber="2"/>
            <description>If DocMDP is present, then the Signature References dictionary (ISO 32000-1:2008, 12.8.1, Table 253) shall not contain the keys DigestLocation, DigestMethod, and DigestValue</description>
            <test>permsContainDocMDP == false || entries.split('&amp;').filter(elem =&gt; elem == 'DigestLocation' || elem == 'DigestMethod' || elem == 'DigestValue').length == 0</test>
            <error>
                <message>The Signature References dictionary contains %1 key(s) in presence of DocMDP entry in the permissions dictionary</message>
                <arguments>
                    <argument>entries.split('&amp;').filter(elem =&gt; elem == 'DigestLocation' ||
                        elem == 'DigestMethod' || elem == 'DigestValue').toString()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="12.8.1"/>
            </references>
        </rule>
        <rule object="CosInteger">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="1"/>
            <description>A conforming file shall not contain any integer greater than 2147483647. A conforming file shall not contain any integer less than -2147483648</description>
            <test>(intValue &lt;= 2147483647) &amp;&amp; (intValue &gt;= -2147483648)</test>
            <error>
                <message>Integer value %1 out of range</message>
                <arguments>
                    <argument>intValue</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosReal">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="2"/>
            <description>A conforming file shall not contain any real number outside the range of +/-3.403 x 10^38</description>
            <test>(realValue &gt;= -3.403e+38) &amp;&amp; (realValue &lt;= 3.403e+38)</test>
            <error>
                <message>Real value %1 out of range</message>
                <arguments>
                    <argument>realValue</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosString">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="3"/>
            <description>A conforming file shall not contain any string longer than 32767 bytes</description>
            <test>value.length() &lt; 32768</test>
            <error>
                <message>String length (%1) exceeded 32767</message>
                <arguments>
                    <argument>value.length()</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosName">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="4"/>
            <description>A conforming file shall not contain any name longer than 127 bytes</description>
            <test>internalRepresentation.length() &lt;= 127</test>
            <error>
                <message>Name length (%1) exceeded 127</message>
                <arguments>
                    <argument>internalRepresentation.length()</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosReal">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="5"/>
            <description>A conforming file shall not contain any real number closer to zero than +/-1.175 x 10^(-38)</description>
            <test>realValue == 0.0 || (realValue &lt;= -1.175e-38) || (realValue &gt;= 1.175e-38)</test>
            <error>
                <message>Non-zero real value %1 is too close to 0.0</message>
                <arguments>
                    <argument>realValue</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="7"/>
            <description>A conforming file shall not contain more than 8388607 indirect objects</description>
            <test>nrIndirects &lt;= 8388607</test>
            <error>
                <message>Number of indirect objects in a PDF file (%1) exceeded 8,388,607</message>
                <arguments>
                    <argument>nrIndirects</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="Op_q_gsave">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="8"/>
            <description>A conforming file shall not nest q/Q pairs by more than 28 nesting levels</description>
            <test>nestingLevel &lt;= 28</test>
            <error>
                <message>Depth of graphics state nesting of q/Q operators (%1) exceeded 28</message>
                <arguments>
                    <argument>nestingLevel</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDDeviceN">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="9"/>
            <description>A conforming file shall not contain a DeviceN colour space with more than 32 colourants</description>
            <test>nrComponents &lt;= 32</test>
            <error>
                <message>Number of DeviceN components (%1) exceeded 32</message>
                <arguments>
                    <argument>nrComponents</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CMapFile">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="10"/>
            <description>A conforming file shall not contain a CID value greater than 65535</description>
            <test>maximalCID &lt;= 65535</test>
            <error>
                <message>Value of a CID (%1) exceeded 65,535</message>
                <arguments>
                    <argument>maximalCID</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosBBox">
            <id specification="ISO_19005_2" clause="6.1.13" testNumber="11"/>
            <description>The size of any of the page boundaries described in ISO 32000-1:2008, 14.11.2 shall not be less than 3 units in either direction, nor shall it be greater than 14 400 units in either direction</description>
            <test>Math.abs(top - bottom) &gt;= 3 &amp;&amp; Math.abs(top - bottom) &lt;= 14400 &amp;&amp; Math.abs(right - left) &gt;= 3 &amp;&amp; Math.abs(right - left) &lt;= 14400</test>
            <error>
                <message>One of the page boundaries is out of range (valid range: 3 - 14400, height = %1, width = %2)</message>
                <arguments>
                    <argument>Math.abs(top - bottom)</argument>
                    <argument>Math.abs(right - left)</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="Op_Undefined">
            <id specification="ISO_19005_2" clause="6.2.2" testNumber="1"/>
            <description>Content streams shall not contain any operators not defined in ISO 32000-1 even if such operators are bracketed by the BX/EX compatibility operators</description>
            <test>false</test>
            <error>
                <message>A content stream contains operator %1 not defined in ISO 32000-1</message>
                <arguments>
                    <argument>name</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDContentStream" deferred="true">
            <id specification="ISO_19005_2" clause="6.2.2" testNumber="2"/>
            <description>A content stream that references other objects, such as images and fonts that are necessary to fully render or process the stream, shall have an explicitly associated Resources dictionary as described in ISO 32000-1:2008, 7.8.3</description>
            <test>inheritedResourceNames == ''</test>
            <error>
                <message>A content stream refers to resource(s) %1 not defined in an explicitly associated Resources dictionary</message>
                <arguments>
                    <argument>inheritedResourceNames</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="7.8.3"/>
            </references>
        </rule>
        <rule object="ICCOutputProfile">
            <id specification="ISO_19005_2" clause="6.2.3" testNumber="1"/>
            <description>The profile stream that is the value of the DestOutputProfile key shall either be an output profile (Device Class = "prtr") or a monitor profile (Device Class = "mntr"). The profiles shall have a colour space of either "GRAY", "RGB", or "CMYK"</description>
            <test>(deviceClass == "prtr" || deviceClass == "mntr") &amp;&amp; (colorSpace == "RGB " || colorSpace == "CMYK" || colorSpace == "GRAY") &amp;&amp; version &lt; 5.0</test>
            <error>
                <message>The embedded PDF/A Output Intent colour profile has invalid header (Device Class = %1, color space = %2, version = %3)</message>
                <arguments>
                    <argument>deviceClass</argument>
                    <argument>colorSpace</argument>
                    <argument>version</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.11.5"/>
            </references>
        </rule>
        <rule object="OutputIntents">
            <id specification="ISO_19005_2" clause="6.2.3" testNumber="2"/>
            <description>If a file's OutputIntents array contains more than one entry, as might be the case where a file is compliant with this part of ISO 19005 and at the same time with PDF/X-4 or PDF/E-1, then all entries that contain a DestOutputProfile key shall have as the value of that key the same indirect object, which shall be a valid ICC profile stream</description>
            <test>sameOutputProfileIndirect == true</test>
            <error>
                <message>File's OutputIntents array contains output intent dictionaries with non-matching destination output profiles (indirect keys %1)</message>
                <arguments>
                    <argument>outputProfileIndirects</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDOutputIntent">
            <id specification="ISO_19005_2" clause="6.2.3" testNumber="3"/>
            <description>In addition, the DestOutputProfileRef key, as defined in ISO 15930-7:2010, Annex A, shall not be present in any PDF/X OutputIntent</description>
            <test>S != 'GTS_PDFX' || containsDestOutputProfileRef == false</test>
            <error>
                <message>The PDF/X output intent dictionary contains forbidden entry DestOutputProfileRef</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 15930-7:2010" clause="Annex A"/>
            </references>
        </rule>
        <rule object="ICCInputProfile">
            <id specification="ISO_19005_2" clause="6.2.4.2" testNumber="1"/>
            <description>The profile that forms the stream of an ICCBased colour space shall conform to ICC.1:1998-09, ICC.1:2001-12, ICC.1:2003-09 or ISO 15076-1</description>
            <test>(deviceClass == "prtr" || deviceClass == "mntr" || deviceClass == "scnr" || deviceClass == "spac") &amp;&amp; (colorSpace == "RGB " || colorSpace == "CMYK" || colorSpace == "GRAY" || colorSpace == "Lab ") &amp;&amp; version &lt; 5.0</test>
            <error>
                <message>The embedded ICC profile (Device Class = %1, color space = %2, version = %3) is either invalid or does not satisfy PDF 1.7 requirements</message>
                <arguments>
                    <argument>deviceClass</argument>
                    <argument>colorSpace</argument>
                    <argument>version</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="8.6.5.5"/>
            </references>
        </rule>
        <rule object="PDICCBasedCMYK">
            <id specification="ISO_19005_2" clause="6.2.4.2" testNumber="2"/>
            <description>Overprint mode (as set by the OPM value in an ExtGState dictionary) shall not be one (1) when an ICCBased CMYK colour space is used for stroke and overprinting for stroke is set to true, or when ICCBased CMYK colour space is used for fill and overprinting for fill is set to true, or both</description>
            <test>overprintFlag == false || OPM == 0</test>
            <error>
                <message>Overprint mode (OPM) is set to %1 instead of 0 when an ICCBased CMYK colour space is used with enabled overprinting</message>
                <arguments>
                    <argument>OPM</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="8.6.7"/>
            </references>
        </rule>
        <rule object="PDDeviceRGB">
            <id specification="ISO_19005_2" clause="6.2.4.3" testNumber="2"/>
            <description>DeviceRGB shall only be used if a device independent DefaultRGB colour space has been set when the DeviceRGB colour space is used, or if the file has a PDF/A OutputIntent that contains an RGB destination profile</description>
            <test>gOutputCS != null &amp;&amp; gOutputCS == "RGB "</test>
            <error>
                <message>DeviceRGB colour space is used without RGB output intent profile</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDDeviceCMYK">
            <id specification="ISO_19005_2" clause="6.2.4.3" testNumber="3"/>
            <description>DeviceCMYK shall only be used if a device independent DefaultCMYK colour space has been set or if a DeviceN-based DefaultCMYK colour space has been set when the DeviceCMYK colour space is used or the file has a PDF/A OutputIntent that contains a CMYK destination profile</description>
            <test>gOutputCS != null &amp;&amp; gOutputCS == "CMYK"</test>
            <error>
                <message>DeviceCMYK colour space is used without CMYK output intent profile</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDDeviceGray">
            <id specification="ISO_19005_2" clause="6.2.4.3" testNumber="4"/>
            <description>DeviceGray shall only be used if a device independent DefaultGray colour space has been set when the DeviceGray colour space is used, or if a PDF/A OutputIntent is present</description>
            <test>gOutputCS != null</test>
            <error>
                <message>DeviceGray colour space is used without output intent profile</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDDeviceN">
            <id specification="ISO_19005_2" clause="6.2.4.4" testNumber="1"/>
            <description>For any spot colour used in a DeviceN or NChannel colour space, an entry in the Colorants dictionary shall be present</description>
            <test>areColorantsPresent == true</test>
            <error>
                <message>A colorant of the DeviceN or NChannel color space is not defined in the Colorants dictionary</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="8.6.6.5, Table 71"/>
            </references>
        </rule>
        <rule object="PDSeparation">
            <id specification="ISO_19005_2" clause="6.2.4.4" testNumber="2"/>
            <description>All Separation arrays within a single PDF/A-2 file (including those in Colorants dictionaries) that have the same name shall have the same tintTransform and alternateSpace. In evaluating equivalence, the PDF objects shall be compared, rather than the computational result of the use of those PDF objects. Compression and whether or not an object is direct or indirect shall be ignored</description>
            <test>areTintAndAlternateConsistent == true</test>
            <error>
                <message>Several occurrences of a Separation colour space with the same name are not consistent</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDExtGState">
            <id specification="ISO_19005_2" clause="6.2.5" testNumber="1"/>
            <description>An ExtGState dictionary shall not contain the TR key</description>
            <test>containsTR == false</test>
            <error>
                <message>An ExtGState dictionary contains the TR key</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDExtGState">
            <id specification="ISO_19005_2" clause="6.2.5" testNumber="2"/>
            <description>An ExtGState dictionary shall not contain the TR2 key with a value other than Default</description>
            <test>containsTR2 == false || TR2NameValue == "Default"</test>
            <error>
                <message>An ExtGState dictionary contains the TR2 key with a value other than Default</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDExtGState">
            <id specification="ISO_19005_2" clause="6.2.5" testNumber="3"/>
            <description>An ExtGState dictionary shall not contain the HTP key</description>
            <test>containsHTP == false</test>
            <error>
                <message>An ExtGState dictionary contains the HTP key</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDHalftone">
            <id specification="ISO_19005_2" clause="6.2.5" testNumber="4"/>
            <description>All halftones in a conforming PDF/A-2 file shall have the value 1 or 5 for the HalftoneType key</description>
            <test>HalftoneType != null &amp;&amp; (HalftoneType == 1 || HalftoneType == 5)</test>
            <error>
                <message>A Halftone has type %1 instead of 1 or 5</message>
                <arguments>
                    <argument>HalftoneType</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDHalftone">
            <id specification="ISO_19005_2" clause="6.2.5" testNumber="5"/>
            <description>Halftones in a conforming PDF/A-2 file shall not contain a HalftoneName key</description>
            <test>HalftoneName == null</test>
            <error>
                <message>A Halftone dictionary contains the HalftoneName key</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDHalftone">
            <id specification="ISO_19005_2" clause="6.2.5" testNumber="6"/>
            <description>The TransferFunction key in a halftone dictionary shall be used only as required by ISO 32000-1</description>
            <test>colorantName == 'Default' || ((colorantName == null || colorantName == 'Cyan' || colorantName == 'Magenta' || colorantName == 'Yellow' || colorantName == 'Black') ? TransferFunction == null : TransferFunction != null)</test>
            <error>
                <message>Custom TransferFunction in a Halftone dictionary is not permitted for primary (CMYK) colorants</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="Table 130"/>
            </references>
        </rule>
        <rule object="CosRenderingIntent">
            <id specification="ISO_19005_2" clause="6.2.6" testNumber="1"/>
            <description>Where a rendering intent is specified, its value shall be one of the four values defined in ISO 32000-1:2008, Table 70: RelativeColorimetric, AbsoluteColorimetric, Perceptual or Saturation</description>
            <test>internalRepresentation == "RelativeColorimetric" || internalRepresentation == "AbsoluteColorimetric" || internalRepresentation == "Perceptual" || internalRepresentation == "Saturation"</test>
            <error>
                <message>A rendering intent with non-standard value %1 is used</message>
                <arguments>
                    <argument>internalRepresentation</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDXImage">
            <id specification="ISO_19005_2" clause="6.2.8" testNumber="1"/>
            <description>An Image dictionary shall not contain the Alternates key</description>
            <test>containsAlternates == false</test>
            <error>
                <message>Alternates key is present in the Image dictionary</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXImage">
            <id specification="ISO_19005_2" clause="6.2.8" testNumber="2"/>
            <description>An Image dictionary shall not contain the OPI key</description>
            <test>containsOPI == false</test>
            <error>
                <message>OPI key is present in the Image dictionary</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXImage">
            <id specification="ISO_19005_2" clause="6.2.8" testNumber="3"/>
            <description>If an Image dictionary contains the Interpolate key, its value shall be false. For an inline image, the I key shall have a value of false</description>
            <test>Interpolate == false</test>
            <error>
                <message>The value of the Interpolate key in the Image dictionary is true</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXImage">
            <id specification="ISO_19005_2" clause="6.2.8" testNumber="4"/>
            <description>If an Image dictionary contains the BitsPerComponent key, its value shall be 1, 2, 4, 8 or 16</description>
            <test>isMask == true || BitsPerComponent == null || BitsPerComponent == 1 || BitsPerComponent == 2 || BitsPerComponent == 4 || BitsPerComponent == 8 || BitsPerComponent == 16</test>
            <error>
                <message>The value of the BitsPerComponent key in the Image dictionary is %1</message>
                <arguments>
                    <argument>BitsPerComponent</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="8.9.5.1, Table 89"/>
            </references>
        </rule>
        <rule object="PDMaskImage">
            <id specification="ISO_19005_2" clause="6.2.8" testNumber="5"/>
            <description>If an image mask dictionary contains the BitsPerComponent key, its value shall be 1</description>
            <test>BitsPerComponent == null || BitsPerComponent == 1</test>
            <error>
                <message>The value of the BitsPerComponent key in the image mask dictionary is %1</message>
                <arguments>
                    <argument>BitsPerComponent</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="8.9.5.1, Table 89"/>
            </references>
        </rule>
        <rule object="JPEG2000">
            <id specification="ISO_19005_2" clause="6.2.8.3" testNumber="1"/>
            <description>The number of colour channels in the JPEG2000 data shall be 1, 3 or 4</description>
            <test>nrColorChannels == 1 || nrColorChannels == 3 || nrColorChannels == 4</test>
            <error>
                <message>JPEG2000 image has %1 colour channels that is neither 1, 3 or 4</message>
                <arguments>
                    <argument>nrColorChannels</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="JPEG2000">
            <id specification="ISO_19005_2" clause="6.2.8.3" testNumber="2"/>
            <description>If the number of colour space specifications in the JPEG2000 data is greater than 1, there shall be exactly one colour space specification that has the value 0x01 in the APPROX field</description>
            <test>hasColorSpace == true || nrColorSpaceSpecs == 1 || nrColorSpacesWithApproxField == 1</test>
            <error>
                <message>The JPEG2000 image contains %1 colour specifications with the best colour fidelity (value 0x01 in the APPROX field)</message>
                <arguments>
                    <argument>nrColorSpacesWithApproxField</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="JPEG2000">
            <id specification="ISO_19005_2" clause="6.2.8.3" testNumber="3"/>
            <description>The value of the METH entry in its 'colr' box shall be 0x01, 0x02 or 0x03. A conforming reader shall use only that colour space and shall ignore all other colour space specifications</description>
            <test>hasColorSpace == true || colrMethod == 1 || colrMethod == 2 || colrMethod == 3</test>
            <error>
                <message>Invalid JPEG2000 image: the value of the METH entry (%1) in its 'colr' box is different from 0x01, 0x02 or 0x03</message>
                <arguments>
                    <argument>colrMethod</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="JPEG2000">
            <id specification="ISO_19005_2" clause="6.2.8.3" testNumber="4"/>
            <description>JPEG2000 enumerated colour space 19 (CIEJab) shall not be used</description>
            <test>hasColorSpace == true || colrEnumCS == null || colrEnumCS != 19</test>
            <error>
                <message>JPEG2000 image uses enumerated colour space 19 (CIEJab), which is not allowed in PDF/A</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="JPEG2000">
            <id specification="ISO_19005_2" clause="6.2.8.3" testNumber="5"/>
            <description>The bit-depth of the JPEG2000 data shall have a value in the range 1 to 38. All colour channels in the JPEG2000 data shall have the same bit-depth</description>
            <test>bpccBoxPresent == false &amp;&amp; (bitDepth &gt;= 1 &amp;&amp; bitDepth &lt;= 38)</test>
            <error>
                <message>JPEG2000 image has different bit-depth parameters in 'bpcc' box, or bit depth is out of range ('bpcc' box present = %1, bit depth = %2)</message>
                <arguments>
                    <argument>bpccBoxPresent</argument>
                    <argument>bitDepth</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDXForm">
            <id specification="ISO_19005_2" clause="6.2.9" testNumber="1"/>
            <description>A form XObject dictionary shall not contain any of the following: - the OPI key; - the Subtype2 key with a value of PS; - the PS key</description>
            <test>(Subtype2 == null || Subtype2 != "PS") &amp;&amp; containsPS == false &amp;&amp; containsOPI == false</test>
            <error>
                <message>The form XObject dictionary contains a PS key, or a Subtype2 key with value PS, or an OPI key</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXForm">
            <id specification="ISO_19005_2" clause="6.2.9" testNumber="2"/>
            <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="PDXObject">
            <id specification="ISO_19005_2" clause="6.2.9" testNumber="3"/>
            <description>A conforming file shall not contain any PostScript XObjects</description>
            <test>Subtype != "PS"</test>
            <error>
                <message>The document contains a PostScript XObject</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosBM">
            <id specification="ISO_19005_2" clause="6.2.10" testNumber="1"/>
            <description>Only blend modes that are specified in ISO 32000-1:2008 shall be used for the value of the BM key in an extended graphic state dictionary</description>
            <test>internalRepresentation == "Normal" || internalRepresentation == "Compatible" || internalRepresentation == "Multiply" || internalRepresentation == "Screen" || internalRepresentation == "Overlay" || internalRepresentation == "Darken" || internalRepresentation == "Lighten" || internalRepresentation == "ColorDodge" || internalRepresentation == "ColorBurn" || internalRepresentation == "HardLight" || internalRepresentation == "SoftLight" || internalRepresentation == "Difference" || internalRepresentation == "Exclusion" || internalRepresentation == "Hue" || internalRepresentation == "Saturation" || internalRepresentation == "Color" || internalRepresentation == "Luminosity"</test>
            <error>
                <message>The document uses the blend mode %1 not defined in ISO 32000-1:2008</message>
                <arguments>
                    <argument>internalRepresentation</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="11.3.5, Tables 136-137"/>
            </references>
        </rule>
        <rule object="PDPage">
            <id specification="ISO_19005_2" clause="6.2.10" testNumber="2"/>
            <description>If the document does not contain a PDF/A OutputIntent, then all Page objects that contain transparency shall include the Group key, and the attribute dictionary that forms the value of that Group key shall include a CS entry whose value shall be used as the default blending colour space</description>
            <test>gOutputCS != null || containsGroupCS == true || containsTransparency == false</test>
            <error>
                <message>The page contains transparent objects with no blending colour space defined</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="11.3.4"/>
            </references>
        </rule>
        <rule object="PDFont">
            <id specification="ISO_19005_2" clause="6.2.11.2" testNumber="1"/>
            <description>All fonts and font programs used in a conforming file, regardless of rendering mode usage, shall conform to the provisions in ISO 32000-1:2008, 9.6 and 9.7, as well as to the font specifications referenced by these provisions. Type - name - (Required) The type of PDF object that this dictionary describes; must be Font for a font dictionary</description>
            <test>Type == "Font"</test>
            <error>
                <message>A Font dictionary has value %1 of Type entry instead of Font</message>
                <arguments>
                    <argument>Type</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.6.2.1, Table 111"/>
                <reference specification="ISO 32000-1:2008" clause="9.6.5, Table 112"/>
                <reference specification="ISO 32000-1:2008" clause="9.7.4.1, Table 117"/>
                <reference specification="ISO 32000-1:2008" clause="9.7.6.1, Table 121"/>
            </references>
        </rule>
        <rule object="PDFont">
            <id specification="ISO_19005_2" clause="6.2.11.2" testNumber="2"/>
            <description>All fonts and font programs used in a conforming file, regardless of rendering mode usage, shall conform to the provisions in ISO 32000-1:2008, 9.6 and 9.7, as well as to the font specifications referenced by these provisions. Subtype - name - (Required) The type of font; must be "Type1" for Type 1 fonts, "MMType1" for multiple master fonts, "TrueType" for TrueType fonts "Type3" for Type 3 fonts, "Type0" for Type 0 fonts and "CIDFontType0" or "CIDFontType2" for CID fonts</description>
            <test>Subtype == "Type1" || Subtype == "MMType1" || Subtype == "TrueType" || Subtype == "Type3" || Subtype == "Type0" || Subtype == "CIDFontType0" || Subtype == "CIDFontType2"</test>
            <error>
                <message>Invalid Subtype entry in font dictionary with value %1</message>
                <arguments>
                    <argument>Subtype</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.6.2.1, Table 111"/>
                <reference specification="ISO 32000-1:2008" clause="9.6.2.3"/>
                <reference specification="ISO 32000-1:2008" clause="9.6.3"/>
                <reference specification="ISO 32000-1:2008" clause="9.6.5, Table 112"/>
                <reference specification="ISO 32000-1:2008" clause="9.7.4.1, Table 117"/>
                <reference specification="ISO 32000-1:2008" clause="9.7.6.1, Table 121"/>
            </references>
        </rule>
        <rule object="PDFont">
            <id specification="ISO_19005_2" clause="6.2.11.2" testNumber="3"/>
            <description>All fonts and font programs used in a conforming file, regardless of rendering mode usage, shall conform to the provisions in ISO 32000-1:2008, 9.6 and 9.7, as well as to the font specifications referenced by these provisions. BaseFont - name - (Required) The PostScript name of the font</description>
            <test>Subtype == "Type3" || fontName != null</test>
            <error>
                <message>A BaseFont entry is missing or has invalid type</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.6.2.1, Table 111"/>
                <reference specification="ISO 32000-1:2008" clause="9.7.4.1, Table 117"/>
                <reference specification="ISO 32000-1:2008" clause="9.7.6.1, Table 121"/>
            </references>
        </rule>
        <rule object="PDSimpleFont">
            <id specification="ISO_19005_2" clause="6.2.11.2" testNumber="4"/>
            <description>All fonts and font programs used in a conforming file, regardless of rendering mode usage, shall conform to the provisions in ISO 32000-1:2008, 9.6 and 9.7, as well as to the font specifications referenced by these provisions. FirstChar - integer - (Required except for the standard 14 fonts) The first character code defined in the font's Widths array</description>
            <test>isStandard == true || FirstChar != null</test>
            <error>
                <message>A non-standard simple font dictionary has missing or invalid FirstChar entry</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.6.2.1, Table 111"/>
                <reference specification="ISO 32000-1:2008" clause="9.6.5, Table 112"/>
            </references>
        </rule>
        <rule object="PDSimpleFont">
            <id specification="ISO_19005_2" clause="6.2.11.2" testNumber="5"/>
            <description>All fonts and font programs used in a conforming file, regardless of rendering mode usage, shall conform to the provisions in ISO 32000-1:2008, 9.6 and 9.7, as well as to the font specifications referenced by these provisions. LastChar - integer - (Required except for the standard 14 fonts) The last character code defined in the font's Widths array</description>
            <test>isStandard == true || LastChar != null</test>
            <error>
                <message>A non-standard simple font dictionary has missing or invalid LastChar entry</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.6.2.1, Table 111"/>
                <reference specification="ISO 32000-1:2008" clause="9.6.5, Table 112"/>
            </references>
        </rule>
        <rule object="PDSimpleFont">
            <id specification="ISO_19005_2" clause="6.2.11.2" testNumber="6"/>
            <description>All fonts and font programs used in a conforming file, regardless of rendering mode usage, shall conform to the provisions in ISO 32000-1:2008, 9.6 and 9.7, as well as to the font specifications referenced by these provisions. Widths - array - (Required except for the standard 14 fonts; indirect reference preferred) An array of (LastChar − FirstChar + 1) widths</description>
            <test>isStandard == true || (Widths_size != null &amp;&amp; Widths_size == LastChar - FirstChar + 1)</test>
            <error>
                <message>Widths array is missing or has invalid size %1 instead of %2</message>
                <arguments>
                    <argument>Widths_size</argument>
                    <argument>LastChar - FirstChar + 1</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.6.2.1, Table 111"/>
                <reference specification="ISO 32000-1:2008" clause="9.6.5, Table 112"/>
            </references>
        </rule>
        <rule object="PDFont">
            <id specification="ISO_19005_2" clause="6.2.11.2" testNumber="7"/>
            <description>All fonts used in a conforming file shall conform to the font specifications defined in PDF Reference 5.5. The subtype is the value of the Subtype key, if present, in the font file stream dictionary. The only valid values of this key in PDF 1.7 are Type1C - Type 1–equivalent font program represented in the Compact Font Format (CFF), CIDFontType0C - Type 0 CIDFont program represented in the Compact Font Format (CFF) and OpenType - OpenType® font program, as described in the OpenType Specification v.1.4</description>
            <test>fontFileSubtype == null || fontFileSubtype == "Type1C" || fontFileSubtype == "CIDFontType0C" || fontFileSubtype == "OpenType"</test>
            <error>
                <message>Unsupported font file format %1 of the embedded font</message>
                <arguments>
                    <argument>fontFileSubtype</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="9.9, Table 126"/>
                <reference specification="Adobe Technical Note #5176, The Compact Font Format Specification" clause=""/>
                <reference specification="OpenType Font Specification 1.4, December 2004, Microsoft" clause=""/>
            </references>
        </rule>
        <rule object="PDType0Font">
            <id specification="ISO_19005_2" clause="6.2.11.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">
            <id specification="ISO_19005_2" clause="6.2.11.3.2" testNumber="1"/>
            <description>ISO 32000-1:2008, 9.7.4, Table 117 requires that all embedded Type 2 CIDFonts in the CIDFont dictionary shall contain a CIDToGIDMap entry that shall be a stream mapping from CIDs to glyph indices or the name Identity, as described in ISO 32000-1:2008, 9.7.4, Table 117</description>
            <test>Subtype != "CIDFontType2" || CIDToGIDMap != null || 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">
            <id specification="ISO_19005_2" clause="6.2.11.3.3" testNumber="1"/>
            <description>All CMaps used within a PDF/A-2 file, except those listed in ISO 32000-1:2008, 9.7.5.2, Table 118, shall be embedded in that file as described in ISO 32000-1:2008, 9.7.5</description>
            <test>CMapName == "Identity-H" || CMapName == "Identity-V" || CMapName == "GB-EUC-H" || CMapName == "GB-EUC-V" || CMapName == "GBpc-EUC-H" || CMapName == "GBpc-EUC-V" || CMapName == "GBK-EUC-H" || CMapName == "GBK-EUC-V" || CMapName == "GBKp-EUC-H" || CMapName == "GBKp-EUC-V" || CMapName == "GBK2K-H" || CMapName == "GBK2K-V" || CMapName == "UniGB-UCS2-H" || CMapName == "UniGB-UCS2-V" || CMapName == "UniGB-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">
            <id specification="ISO_19005_2" clause="6.2.11.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">
            <id specification="ISO_19005_2" clause="6.2.11.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">
            <id specification="ISO_19005_2" clause="6.2.11.4.1" testNumber="1"/>
            <description>The font programs for all fonts used for rendering within a conforming file shall be embedded within that file, as defined in ISO 32000-1:2008, 9.9</description>
            <test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || 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">
            <id specification="ISO_19005_2" clause="6.2.11.4.1" testNumber="2"/>
            <description>Embedded fonts shall define all glyphs referenced for rendering within the conforming file. A font referenced for use solely in rendering mode 3 is therefore not rendered and is thus exempt from the embedding requirement. 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.6.6.4"/>
            </references>
        </rule>
        <rule object="PDType1Font">
            <id specification="ISO_19005_2" clause="6.2.11.4.2" testNumber="1"/>
            <description>If the FontDescriptor dictionary of an embedded Type 1 font contains a CharSet string, then it shall list the character names of all glyphs present in the font program, regardless of whether a glyph in the font is referenced or used by the PDF or not</description>
            <test>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">
            <id specification="ISO_19005_2" clause="6.2.11.4.2" testNumber="2"/>
            <description>If the FontDescriptor dictionary of an embedded CID font contains a CIDSet stream, then it shall identify all CIDs which are present in the font program, regardless of whether a CID in the font is referenced or used by the PDF or not</description>
            <test>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">
            <id specification="ISO_19005_2" clause="6.2.11.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">
            <id specification="ISO_19005_2" clause="6.2.11.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">
            <id specification="ISO_19005_2" clause="6.2.11.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 that is the value of the Encoding key in the Font dictionary. In addition, all non-symbolic TrueType fonts shall not 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">
            <id specification="ISO_19005_2" clause="6.2.11.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">
            <id specification="ISO_19005_2" clause="6.2.11.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">
            <id specification="ISO_19005_2" clause="6.2.11.7.2" 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 19005-2, 6.2.11.7.2</description>
            <test>toUnicode != null</test>
            <error>
                <message>The glyph can not be mapped to Unicode</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 19005-2:2011" clause="6.2.11.7.2"/>
            </references>
        </rule>
        <rule object="Glyph">
            <id specification="ISO_19005_2" clause="6.2.11.7.2" 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">
            <id specification="ISO_19005_2" clause="6.2.11.7.3" testNumber="1"/>
            <description>For any character, regardless of its rendering mode, that is mapped to a code or codes in the Unicode Private Use Area (PUA), an ActualText entry as described in ISO 32000-1:2008, 14.9.4 shall be present for this character or a sequence of characters of which such a character is a part</description>
            <test>unicodePUA == false || actualTextPresent == true</test>
            <error>
                <message>The character has Unicode value from Private Use Area, and no replacement text present</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.9.4"/>
            </references>
        </rule>
        <rule object="Glyph">
            <id specification="ISO_19005_2" clause="6.2.11.8" testNumber="1"/>
            <description>A PDF/A-2 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>
        <rule object="PDAnnot">
            <id specification="ISO_19005_2" clause="6.3.1" testNumber="1"/>
            <description>Annotation types not defined in ISO 32000-1 shall not be permitted. Additionally, the 3D, Sound, Screen and Movie types shall not be permitted</description>
            <test>Subtype == "Text" || Subtype == "Link" || Subtype == "FreeText" || Subtype == "Line" || Subtype == "Square" || Subtype == "Circle" || Subtype == "Polygon" || Subtype == "PolyLine" || Subtype == "Highlight" || Subtype == "Underline" || Subtype == "Squiggly" || Subtype == "StrikeOut" || Subtype == "Stamp" || Subtype == "Caret" || Subtype == "Ink" || Subtype == "Popup" || Subtype == "FileAttachment" || Subtype == "Widget" || Subtype == "PrinterMark" || Subtype == "TrapNet" || Subtype == "Watermark" || Subtype == "Redact"</test>
            <error>
                <message>Unknown or not permitted Annotation type %1</message>
                <arguments>
                    <argument>Subtype</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="12.5.6.1, Table 169"/>
            </references>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_2" clause="6.3.2" testNumber="1"/>
            <description>Except for annotation dictionaries whose Subtype value is Popup, all annotation dictionaries shall contain the F key</description>
            <test>Subtype == "Popup" || F != null</test>
            <error>
                <message>A dictionary of %1 annotation does not contain F key</message>
                <arguments>
                    <argument>Subtype</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_2" clause="6.3.2" testNumber="2"/>
            <description>If present, the F key's Print flag bit shall be set to 1 and its Hidden, Invisible, ToggleNoView, and NoView flag bits shall be set to 0</description>
            <test>F == null || ((F &amp; 1) == 0 &amp;&amp; (F &amp; 2) == 0 &amp;&amp; (F &amp; 4) == 4 &amp;&amp; (F &amp; 32) == 0 &amp;&amp; (F &amp; 256) == 0)</test>
            <error>
                <message>Annotation flags are set the annotation to be hidden/invisible or non-printable (F = %1, Print = %2, Hidden = %3, Invisible = %4, NoView = %5, ToggleNoView = %6)</message>
                <arguments>
                    <argument>F</argument>
                    <argument>(F &amp; 4) &gt;&gt; 2</argument>
                    <argument>(F &amp; 2) &gt;&gt; 1</argument>
                    <argument>(F &amp; 1)</argument>
                    <argument>(F &amp; 32) &gt;&gt; 5</argument>
                    <argument>(F &amp; 256) &gt;&gt; 8</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_2" clause="6.3.3" testNumber="1"/>
            <description>Every annotation (including those whose Subtype value is Widget, as used for form fields), except for the two cases listed below, shall have at least one appearance dictionary: - annotations where the value of the Rect key consists of an array where value 1 is equal to value 3 and value 2 is equal to value 4; - annotations whose Subtype value is Popup or Link</description>
            <test>(width == 0 &amp;&amp; height == 0) || Subtype == "Popup" || Subtype == "Link" || AP != null</test>
            <error>
                <message>An annotation does not contain an appearance dictionary</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_2" clause="6.3.3" testNumber="2"/>
            <description>For all annotation dictionaries containing an AP key, the appearance dictionary that it defines as its value shall contain only the N key</description>
            <test>AP == null || AP == "N"</test>
            <error>
                <message>Annotation's appearance dictionary contains entries %1 other than N</message>
                <arguments>
                    <argument>AP.split('&amp;').filter(elem =&gt; elem != 'N').toString()</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_2" clause="6.3.3" testNumber="3"/>
            <description>If an annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, the value of the N key shall be an appearance subdictionary</description>
            <test>AP != "N" || Subtype != "Widget" || FT != "Btn" || (N_type == "Dict" &amp;&amp; containsAppearances == true)</test>
            <error>
                <message>An annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, but the value of the N key is %1 instead of appearance subdictionary</message>
                <arguments>
                    <argument>N_type</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_2" clause="6.3.3" testNumber="4"/>
            <description>If an annotation dictionary's Subtype key has value other than Widget, or if FT key associated with Widget annotation has value other than Btn, the value of the N key shall be an appearance stream</description>
            <test>AP != "N" || (Subtype == "Widget" &amp;&amp; FT == "Btn") || N_type == "Stream"</test>
            <error>
                <message>An annotation dictionary's Subtype key has a value %1 and its FT key has a value %2, but the value of the N key is not an appearance stream</message>
                <arguments>
                    <argument>Subtype</argument>
                    <argument>FT</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDWidgetAnnot">
            <id specification="ISO_19005_2" clause="6.4.1" testNumber="1"/>
            <description>A Widget annotation dictionary shall not contain the A or AA keys</description>
            <test>containsA == false &amp;&amp; containsAA == false</test>
            <error>
                <message>A Widget annotation contains %1 key(s)</message>
                <arguments>
                    <argument>entries.split('&amp;').filter(elem =&gt; elem == 'A' || elem == 'AA').toString()</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFormField">
            <id specification="ISO_19005_2" clause="6.4.1" testNumber="2"/>
            <description>A Field dictionary shall not contain the A or AA keys</description>
            <test>containsAA == false</test>
            <error>
                <message>A Form field dictionary contains the AA entry</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDAcroForm">
            <id specification="ISO_19005_2" clause="6.4.1" testNumber="3"/>
            <description>The NeedAppearances flag of the interactive form dictionary shall either not be present or shall be false</description>
            <test>NeedAppearances == null || NeedAppearances == false</test>
            <error>
                <message>The interactive form dictionary contains the NeedAppearances flag with value true</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDAcroForm">
            <id specification="ISO_19005_2" clause="6.4.2" testNumber="1"/>
            <description>The document's interactive form dictionary that forms the value of the AcroForm key in the document's Catalog of a PDF/A-2 file, if present, shall not contain the XFA key</description>
            <test>containsXFA == false</test>
            <error>
                <message>The interactive form dictionary contains the XFA key</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_2" clause="6.4.2" testNumber="2"/>
            <description>A document's Catalog shall not contain the NeedsRendering key</description>
            <test>NeedsRendering == false</test>
            <error>
                <message>A document's Catalog contains NeedsRendering flag set to true</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDSignature">
            <id specification="ISO_19005_2" clause="6.4.3" testNumber="1"/>
            <description>When computing the digest for the file, it shall be computed over the entire file, including the signature dictionary but excluding the PDF Signature itself</description>
            <test>doesByteRangeCoverEntireDocument == true</test>
            <error>
                <message>ByteRange array of the digital signature does not cover the entire file (excluding the PDF Signature itself)</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 19005-2:2011" clause="Annex B"/>
                <reference specification="ISO 32000-1:2008" clause="12.8.1"/>
            </references>
        </rule>
        <rule object="PKCSDataObject">
            <id specification="ISO_19005_2" clause="6.4.3" testNumber="2"/>
            <description>The PDF Signature (a DER-encoded PKCS#7 binary data object) shall be placed into the Contents entry of the signature dictionary. The PKCS#7 object shall conform to the PKCS#7 specification in RFC 2315. At minimum, it shall include the signer's X.509 signing certificate</description>
            <test>signingCertificatePresent == true</test>
            <error>
                <message>The DER-encoded PKCS#7 binary data object representing a PDF Signature does not include the signer's X.509 signing certificate</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 19005-2:2011" clause="Annex B"/>
                <reference specification="RFC 2315" clause=""/>
            </references>
        </rule>
        <rule object="PKCSDataObject">
            <id specification="ISO_19005_2" clause="6.4.3" testNumber="3"/>
            <description>The PDF Signature (a DER-encoded PKCS#7 binary data object) shall be placed into the Contents entry of the signature dictionary. The PKCS#7 object shall conform to the PKCS#7 specification in RFC 2315. At minimum, there shall only be a single signer (e.g. a single "SignerInfo" structure) in the PDF Signature</description>
            <test>SignerInfoCount == 1</test>
            <error>
                <message>The DER-encoded PKCS#7 binary data object representing a PDF Signature has %1 signer(s) in the PDF Signature instead of one</message>
                <arguments>
                    <argument>SignerInfoCount</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-2:2011" clause="Annex B"/>
                <reference specification="RFC 2315" clause=""/>
            </references>
        </rule>
        <rule object="PDAction">
            <id specification="ISO_19005_2" clause="6.5.1" testNumber="1"/>
            <description>The Launch, Sound, Movie, ResetForm, ImportData, Hide, SetOCGState, Rendition, Trans, GoTo3DView and JavaScript actions shall not be permitted. Additionally, the deprecated set-state and no-op actions shall not be permitted</description>
            <test>S == "GoTo" || S == "GoToR" || S == "GoToE" || S == "Thread" || S == "URI" || S == "Named" || S == "SubmitForm"</test>
            <error>
                <message>Unknown or not permitted Action type %1</message>
                <arguments>
                    <argument>S</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="12.6.4.1, Table 198"/>
            </references>
        </rule>
        <rule object="PDNamedAction">
            <id specification="ISO_19005_2" clause="6.5.1" testNumber="2"/>
            <description>Named actions other than NextPage, PrevPage, FirstPage, and LastPage shall not be permitted</description>
            <test>N == "NextPage" || N == "PrevPage" || N == "FirstPage" || N == "LastPage"</test>
            <error>
                <message>Unknown or not permitted named action %1</message>
                <arguments>
                    <argument>N</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="12.6.4.11, Table 211"/>
            </references>
        </rule>
        <rule object="PDDocument">
            <id specification="ISO_19005_2" clause="6.5.2" testNumber="1"/>
            <description>The document's Catalog shall not include an AA entry for an additional-actions dictionary</description>
            <test>containsAA == false</test>
            <error>
                <message>The document catalog dictionary contains an additional-actions dictionary (AA entry)</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDPage">
            <id specification="ISO_19005_2" clause="6.5.2" testNumber="2"/>
            <description>The Page dictionary shall not include an AA entry for an additional-actions dictionary</description>
            <test>containsAA == false</test>
            <error>
                <message>The Page dictionary contains an additional-actions dictionary (AA entry)</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDDocument">
            <id specification="ISO_19005_2" clause="6.6.2.1" testNumber="1"/>
            <description>The Catalog dictionary of a conforming file shall contain the Metadata key whose value is a metadata stream as defined in ISO 32000-1:2008, 14.3.2. The metadata stream dictionary shall contain entry Type with value /Metadata and entry Subtype with value /XML</description>
            <test>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="XMPPackage">
            <id specification="ISO_19005_2" clause="6.6.2.1" testNumber="2"/>
            <description>The bytes attribute shall not be used in the header of an XMP packet</description>
            <test>bytes == null</test>
            <error>
                <message>The XMP Package contains bytes attribute</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="XMPPackage">
            <id specification="ISO_19005_2" clause="6.6.2.1" testNumber="3"/>
            <description>The encoding attribute shall not be used in the header of an XMP packet</description>
            <test>encoding == null</test>
            <error>
                <message>The XMP Package contains encoding attribute</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="XMPPackage">
            <id specification="ISO_19005_2" clause="6.6.2.1" testNumber="4"/>
            <description>All metadata streams present in the PDF shall conform to the XMP Specification. All content of all XMP packets shall be well-formed, as defined by Extensible Markup Language (XML) 1.0 (Third Edition), 2.1, and the RDF/XML Syntax Specification (Revised)</description>
            <test>isSerializationValid</test>
            <error>
                <message>A metadata stream is serialized incorrectly and can not be parsed</message>
                <arguments/>
            </error>
            <references>
                <reference specification="XMP Specification September 2005" clause=""/>
                <reference specification="Extensible Markup Language (XML) 1.0 (Third Edition), 04 February 2004" clause="2.1"/>
                <reference specification="RDF/XML Syntax Specification (Revised), 10 February 2004" clause=""/>
            </references>
        </rule>
        <rule object="XMPPackage">
            <id specification="ISO_19005_2" clause="6.6.2.1" testNumber="5"/>
            <description>All metadata streams present in the PDF shall conform to the XMP Specification. The XMP package must be encoded as UTF-8</description>
            <test>actualEncoding == "UTF-8"</test>
            <error>
                <message>The XMP package uses encoding %1 different from UTF-8</message>
                <arguments>
                    <argument>actualEncoding</argument>
                </arguments>
            </error>
            <references>
                <reference specification="XMP Specification, September 2005" clause="5 - Embedding XMP Metadata in Application Files - PDF"/>
            </references>
        </rule>
        <rule object="XMPProperty">
            <id specification="ISO_19005_2" clause="6.6.2.3.1" testNumber="1"/>
            <description>All properties specified in XMP form shall use either the predefined schemas defined in the XMP Specification, ISO 19005-1 or this part of ISO 19005, or any extension schemas that comply with 6.6.2.3.2</description>
            <test>isPredefinedInXMP2005 == true || isDefinedInMainPackage == true || isDefinedInCurrentPackage == true</test>
            <error>
                <message>XMP property is either not predefined, or is not defined in any XMP extension schema</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="XMPProperty">
            <id specification="ISO_19005_2" clause="6.6.2.3.1" testNumber="2"/>
            <description>All properties specified in XMP form shall use either the predefined schemas defined in the XMP Specification, ISO 19005-1 or this part of ISO 19005, or any extension schemas that comply with 6.6.2.3.2</description>
            <test>isValueTypeCorrect == true</test>
            <error>
                <message>XMP property does not correspond to type %1</message>
                <arguments>
                    <argument>predefinedType</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaObject">
            <id specification="ISO_19005_2" clause="6.6.2.3.2" testNumber="1"/>
            <description>Extension schemas shall be specified using the PDF/A extension schema container schema defined in 6.6.2.3.3. All fields described in each of the tables in 6.6.2.3.3 shall be present in any extension schema container schema</description>
            <test>containsUndefinedFields == false</test>
            <error>
                <message>An extension schema object contains field(s) %1 not defined by the specification</message>
                <arguments>
                    <argument>undefinedFields</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemasContainer">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="1"/>
            <description>The extension schema container schema uses the namespace URI "http://www.aiim.org/pdfa/ns/extension/". The required schema namespace prefix is pdfaExtension. pdfaExtension:schemas - Bag Schema - Description of extension schemas</description>
            <test>isValidBag == true &amp;&amp; prefix == "pdfaExtension"</test>
            <error>
                <message>The extension schema container has invalid type (isValidBag = %1) or doesn't have prefix 'pdfaExtension' (prefix = %2)</message>
                <arguments>
                    <argument>isValidBag</argument>
                    <argument>prefix</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="2"/>
            <description>Field 'schema' of the PDF/A Schema value type in the PDF/A extension schema shall be present and shall have type Text and namespace prefix 'pdfaSchema'</description>
            <test>isSchemaValidText == true &amp;&amp; schemaPrefix == "pdfaSchema"</test>
            <error>
                <message>Field 'schema' of the PDF/A Schema value type is not present, or doesn't have prefix 'pdfaSchema' (schema prefix = %1) or doesn't have type Text (isSchemaValidText = %2)</message>
                <arguments>
                    <argument>schemaPrefix</argument>
                    <argument>isSchemaValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="3"/>
            <description>Field 'namespaceURI' of the PDF/A Schema value type in the PDF/A extension schema shall be present and shall have type URI and namespace prefix 'pdfaSchema'</description>
            <test>isNamespaceURIValidURI == true &amp;&amp; namespaceURIPrefix == "pdfaSchema"</test>
            <error>
                <message>Field 'namespaceURI' of the PDF/A Schema value type is not present, or doesn't have prefix 'pdfaSchema' (namespaceURI prefix = %1) or doesn't have type URI (isNamespaceURIValidURI = %2)</message>
                <arguments>
                    <argument>namespaceURIPrefix</argument>
                    <argument>isNamespaceURIValidURI</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="4"/>
            <description>Field 'prefix' of the PDF/A Schema value type in the PDF/A extension schema shall be present and shall have type Text and namespace prefix 'pdfaSchema'</description>
            <test>isPrefixValidText == true &amp;&amp; prefixPrefix == "pdfaSchema"</test>
            <error>
                <message>Field 'prefix' of the PDF/A Schema value type is not present, or doesn't have prefix 'pdfaSchema' (prefix prefix = %1) or doesn't have type Text (isPrefixValidText = %2)</message>
                <arguments>
                    <argument>prefixPrefix</argument>
                    <argument>isPrefixValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="5"/>
            <description>Field 'property' of the PDF/A Schema value type in the PDF/A extension schema shall have type Seq Property and namespace prefix 'pdfaSchema'</description>
            <test>isPropertyValidSeq == true &amp;&amp; (propertyPrefix == null || propertyPrefix == "pdfaSchema")</test>
            <error>
                <message>Field 'property' of the PDF/A Schema value type doesn't have prefix 'pdfaSchema' (property prefix = %1) or doesn't have type Seq Property (isPropertyValidSeq = %2)</message>
                <arguments>
                    <argument>propertyPrefix</argument>
                    <argument>isPropertyValidSeq</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="6"/>
            <description>Field 'valueType' of the PDF/A Schema value type in the PDF/A extension schema shall have type Seq ValueType and namespace prefix 'pdfaSchema'</description>
            <test>isValueTypeValidSeq == true &amp;&amp; (valueTypePrefix == null || valueTypePrefix == "pdfaSchema")</test>
            <error>
                <message>Field 'valueType' of the PDF/A Schema value type doesn't have prefix 'pdfaSchema' (valueType prefix = %1) or doesn't have type Seq ValueType (isValueTypeValidSeq = %2)</message>
                <arguments>
                    <argument>valueTypePrefix</argument>
                    <argument>isValueTypeValidSeq</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaProperty">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="7"/>
            <description>Field 'name' of the PDF/A Property value type in the PDF/A extension schema shall be present and shall have type Text and namespace prefix 'pdfaProperty'</description>
            <test>isNameValidText == true &amp;&amp; namePrefix == "pdfaProperty"</test>
            <error>
                <message>Field 'name' of the PDF/A Property value type is not present, or doesn't have prefix 'pdfaProperty' (name prefix = %1) or doesn't have type Text (isNameValidText = %2)</message>
                <arguments>
                    <argument>namePrefix</argument>
                    <argument>isNameValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaProperty">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="8"/>
            <description>Field 'valueType' of the PDF/A Property value type in the PDF/A extension schema shall be present and shall have type Text and namespace prefix 'pdfaProperty'. Value of valueType property shall be defined</description>
            <test>isValueTypeValidText == true &amp;&amp; isValueTypeDefined == true &amp;&amp; valueTypePrefix == "pdfaProperty"</test>
            <error>
                <message>Field 'valueType' of the PDF/A Property value type is not present, or doesn't have prefix 'pdfaProperty' (valueType prefix = %1) or doesn't have type Text (isValueTypeValidText = %2) or value of valueType doesn't defined (isValueTypeDefined = %3)</message>
                <arguments>
                    <argument>valueTypePrefix</argument>
                    <argument>isValueTypeValidText</argument>
                    <argument>isValueTypeDefined</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaProperty">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="9"/>
            <description>Field 'category' of the PDF/A Property value type in the PDF/A extension schema shall be present and shall have type Text, value external or internal and namespace prefix 'pdfaProperty'</description>
            <test>isCategoryValidText == true &amp;&amp; (category == "external" || category == "internal") &amp;&amp; categoryPrefix == "pdfaProperty"</test>
            <error>
                <message>Field 'category' of the PDF/A Property value type is not present, or doesn't have prefix 'pdfaProperty' (category prefix = %1) or doesn't have type Text (isCategoryValidText = %2) or has value different from external or internal (category value = %3)</message>
                <arguments>
                    <argument>categoryPrefix</argument>
                    <argument>isCategoryValidText</argument>
                    <argument>category</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaProperty">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="10"/>
            <description>Field 'description' of the PDF/A Property value type in the PDF/A extension schema shall be present and shall have type Text and namespace prefix 'pdfaProperty'</description>
            <test>isDescriptionValidText == true &amp;&amp; descriptionPrefix == "pdfaProperty"</test>
            <error>
                <message>Field 'description' of the PDF/A Property value type is not present, or doesn't have prefix 'pdfaProperty' (description prefix = %1) or doesn't have type Text (isDescriptionValidText = %2)</message>
                <arguments>
                    <argument>descriptionPrefix</argument>
                    <argument>isDescriptionValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaValueType">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="11"/>
            <description>Field 'type' of the PDF/A ValueType value type in the PDF/A extension schema shall be present and shall have type Text and namespace prefix 'pdfaType'</description>
            <test>isTypeValidText == true &amp;&amp; typePrefix == "pdfaType"</test>
            <error>
                <message>Field 'type' of the PDF/A ValueType value type is not present, or doesn't have prefix 'pdfaType' (type prefix = %1) or doesn't have type Text (isTypeValidText = %2)</message>
                <arguments>
                    <argument>typePrefix</argument>
                    <argument>isTypeValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaValueType">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="12"/>
            <description>Field 'namespaceURI' of the PDF/A ValueType value type in the PDF/A extension schema shall be present and shall have type URI and namespace prefix 'pdfaType'</description>
            <test>isNamespaceURIValidURI == true &amp;&amp; namespaceURIPrefix == "pdfaType"</test>
            <error>
                <message>Field 'namespaceURI' of the PDF/A ValueType value type is not present, or doesn't have prefix 'pdfaType' (namespaceURI prefix = %1) or doesn't have type URI (isNamespaceURIValidURI = %2)</message>
                <arguments>
                    <argument>namespaceURIPrefix</argument>
                    <argument>isNamespaceURIValidURI</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaValueType">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="13"/>
            <description>Field 'prefix' of the PDF/A ValueType value type in the PDF/A extension schema shall be present and shall have type Text and namespace prefix 'pdfaType'</description>
            <test>isPrefixValidText == true &amp;&amp; prefixPrefix == "pdfaType"</test>
            <error>
                <message>Field 'prefix' of the PDF/A ValueType value type is not present, or doesn't have prefix 'pdfaType' (prefix prefix = %1) or doesn't have type Text (isPrefixValidText = %2)</message>
                <arguments>
                    <argument>prefixPrefix</argument>
                    <argument>isPrefixValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaValueType">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="14"/>
            <description>Field 'description' of the PDF/A ValueType value type in the PDF/A extension schema shall be present and shall have type Text and namespace prefix 'pdfaType'</description>
            <test>isDescriptionValidText == true &amp;&amp; descriptionPrefix == "pdfaType"</test>
            <error>
                <message>Field 'description' of the PDF/A ValueType value type is not present, or doesn't have prefix 'pdfaType' (description prefix = %1) or doesn't have type Text (isDescriptionValidText = %2)</message>
                <arguments>
                    <argument>descriptionPrefix</argument>
                    <argument>isDescriptionValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaValueType">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="15"/>
            <description>Field 'field' of the PDF/A ValueType value type in the PDF/A extension schema shall have type Seq Field and namespace prefix 'pdfaType'</description>
            <test>isFieldValidSeq == true &amp;&amp; (fieldPrefix == null || fieldPrefix == "pdfaType")</test>
            <error>
                <message>Field 'field' of the PDF/A ValueType value type doesn't have prefix 'pdfaType' (field prefix = %1) or doesn't have type Seq Field (isFieldValidSeq = %2)</message>
                <arguments>
                    <argument>fieldPrefix</argument>
                    <argument>isFieldValidSeq</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaField">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="16"/>
            <description>Field 'name' of the PDF/A Field value type in the PDF/A extension schema shall have type Text and namespace prefix 'pdfaField'</description>
            <test>isNameValidText == true &amp;&amp; namePrefix == "pdfaField"</test>
            <error>
                <message>Field 'name' of the PDF/A Field value type is not present, or doesn't have prefix 'pdfaField' (name prefix = %1) or doesn't have type Text (isNameValidText = %2)</message>
                <arguments>
                    <argument>namePrefix</argument>
                    <argument>isNameValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaField">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="17"/>
            <description>Field 'valueType' of the PDF/A Field value type in the PDF/A extension schema shall have type Text and namespace prefix 'pdfaField'. Value of valueType property shall be defined</description>
            <test>isValueTypeValidText == true &amp;&amp; isValueTypeDefined == true &amp;&amp; valueTypePrefix == "pdfaField"</test>
            <error>
                <message>Field 'valueType' of the PDF/A Field value type is not present, or doesn't have prefix 'pdfaField' (valueType prefix = %1) or doesn't have type Text (isValueTypeValidText = %2) or value of valueType doesn't defined (isValueTypeDefined = %3)</message>
                <arguments>
                    <argument>valueTypePrefix</argument>
                    <argument>isValueTypeValidText</argument>
                    <argument>isValueTypeDefined</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="ExtensionSchemaField">
            <id specification="ISO_19005_2" clause="6.6.2.3.3" testNumber="18"/>
            <description>Field 'description' of the PDF/A Field value type in the PDF/A extension schema shall have type Text and namespace prefix 'pdfaField'</description>
            <test>isDescriptionValidText == true &amp;&amp; descriptionPrefix == "pdfaField"</test>
            <error>
                <message>Field 'description' of the PDF/A Field value type is not present, or doesn't have prefix 'pdfaField' (description prefix = %1) or doesn't have type Text (isDescriptionValidText = %2)</message>
                <arguments>
                    <argument>descriptionPrefix</argument>
                    <argument>isDescriptionValidText</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="MainXMPPackage">
            <id specification="ISO_19005_2" clause="6.6.4" testNumber="1"/>
            <description>The PDF/A version and conformance level of a file shall be specified using the PDF/A Identification extension schema</description>
            <test>containsPDFAIdentification == true</test>
            <error>
                <message>The document metadata stream doesn't contain PDF/A Identification Schema</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDFAIdentification">
            <id specification="ISO_19005_2" clause="6.6.4" testNumber="2"/>
            <description>The value of "pdfaid:part" shall be the part number of ISO 19005 to which the file conforms</description>
            <test>part == 2</test>
            <error>
                <message>The "part" property of the PDF/A Identification Schema is %1 instead of 2 for PDF/A-2 conforming file</message>
                <arguments>
                    <argument>part</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFAIdentification">
            <id specification="ISO_19005_2" clause="6.6.4" testNumber="3"/>
            <description>A Level A conforming file shall specify the value of "pdfaid:conformance" as A. A Level B conforming file shall specify the value of "pdfaid:conformance" as B. A Level U conforming file shall specify the value of "pdfaid:conformance" as U</description>
            <test>conformance == "A"</test>
            <error>
                <message>The "conformance" property of the PDF/A Identification Schema is %1 instead of "A" for PDF/A-2a conforming file</message>
                <arguments>
                    <argument>conformance</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFAIdentification">
            <id specification="ISO_19005_2" clause="6.6.4" testNumber="4"/>
            <description>Property "part" of the PDF/A Identification Schema shall have namespace prefix "pdfaid"</description>
            <test>partPrefix == null || partPrefix == "pdfaid"</test>
            <error>
                <message>Property "part" of the PDF/A Identification Schema has invalid namespace prefix %1</message>
                <arguments>
                    <argument>partPrefix</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFAIdentification">
            <id specification="ISO_19005_2" clause="6.6.4" testNumber="5"/>
            <description>Property "conformance" of the PDF/A Identification Schema shall have namespace prefix "pdfaid"</description>
            <test>conformancePrefix == null || conformancePrefix == "pdfaid"</test>
            <error>
                <message>Property "conformance" of the PDF/A Identification Schema has invalid namespace prefix %1</message>
                <arguments>
                    <argument>conformancePrefix</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFAIdentification">
            <id specification="ISO_19005_2" clause="6.6.4" testNumber="6"/>
            <description>Property "amd" of the PDF/A Identification Schema shall have namespace prefix "pdfaid"</description>
            <test>amdPrefix == null || amdPrefix == "pdfaid"</test>
            <error>
                <message>Property "amd" of the PDF/A Identification Schema has invalid namespace prefix %1</message>
                <arguments>
                    <argument>amdPrefix</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFAIdentification">
            <id specification="ISO_19005_2" clause="6.6.4" testNumber="7"/>
            <description>Property "corr" of the PDF/A Identification Schema shall have namespace prefix "pdfaid"</description>
            <test>corrPrefix == null || corrPrefix == "pdfaid"</test>
            <error>
                <message>Property "corr" of the PDF/A Identification Schema has invalid namespace prefix %1</message>
                <arguments>
                    <argument>corrPrefix</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_2" clause="6.7.2.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="PDDocument">
            <id specification="ISO_19005_2" clause="6.7.3.3" testNumber="1"/>
            <description>The logical structure of the conforming file shall be described by a structure hierarchy rooted in the StructTreeRoot entry of the document's Catalog dictionary, as described in ISO 32000-1:2008, 14.7</description>
            <test>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="SENonStandard">
            <id specification="ISO_19005_2" clause="6.7.3.4" testNumber="1"/>
            <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</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="SENonStandard">
            <id specification="ISO_19005_2" clause="6.7.3.4" testNumber="2"/>
            <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>
                <reference specification="ISO 32000-1:2008" clause="14.8.4"/>
            </references>
        </rule>
        <rule object="SENonStandard">
            <id specification="ISO_19005_2" clause="6.7.3.4" testNumber="3"/>
            <description>Standard tags shall not be remapped to a non-standard type</description>
            <test>remappedStandardType == null</test>
            <error>
                <message>The standard structure type %1 is remapped to a non-standard type</message>
                <arguments>
                    <argument>remappedStandardType</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 32000-1:2008" clause="14.8.4"/>
            </references>
        </rule>
        <rule object="CosLang">
            <id specification="ISO_19005_2" clause="6.7.4" testNumber="1"/>
            <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 either be the empty text string, to indicate that the language is unknown, or a Language-Tag as defined in RFC 3066, Tags for the Identification of Languages</description>
            <test>unicodeValue == '' || /^[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="CosFileSpecification">
            <id specification="ISO_19005_2" clause="6.8" testNumber="2"/>
            <description>The file specification dictionary for an embedded file shall contain the F and UF keys</description>
            <test>containsEF == false || (F != null &amp;&amp; UF != null)</test>
            <error>
                <message>The file specification dictionary for an embedded file does not contain either F or UF key (F = %1, UF = %2)</message>
                <arguments>
                    <argument>F</argument>
                    <argument>UF</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="EmbeddedFile">
            <id specification="ISO_19005_2" clause="6.8" testNumber="5"/>
            <description>A file specification dictionary, as defined in ISO 32000-1:2008, 7.11.3, may contain the EF key, provided that the embedded file is compliant with either ISO 19005-1 or this part of ISO 19005</description>
            <test>isValidPDFA12 == true</test>
            <error>
                <message>An embedded file does not comply to either ISO 19005-1 or ISO 19005-2</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDOCConfig">
            <id specification="ISO_19005_2" clause="6.9" 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">
            <id specification="ISO_19005_2" clause="6.9" testNumber="2"/>
            <description>Each optional content configuration dictionary shall contain the Name key, whose value shall be unique amongst all optional content configuration dictionaries within the PDF/A-2 file</description>
            <test>hasDuplicateName == false</test>
            <error>
                <message>Optional content configuration dictionary has duplicated name %1</message>
                <arguments>
                    <argument>Name</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDOCConfig">
            <id specification="ISO_19005_2" clause="6.9" testNumber="3"/>
            <description>If an optional content configuration dictionary contains the Order key, the array which is the value of this Order key shall contain references to all OCGs in the conforming file</description>
            <test>OCGsNotContainedInOrder == null</test>
            <error>
                <message>Optional content group(s) %1 not present in the Order entry of the optional content configuration dictionary</message>
                <arguments>
                    <argument>OCGsNotContainedInOrder</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDOCConfig">
            <id specification="ISO_19005_2" clause="6.9" testNumber="4"/>
            <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="PDDocument">
            <id specification="ISO_19005_2" clause="6.10" testNumber="1"/>
            <description>There shall be no AlternatePresentations entry in the document's name dictionary</description>
            <test>containsAlternatePresentations == false</test>
            <error>
                <message>The document's name dictionary contains the AlternatePresentations entry</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDPage">
            <id specification="ISO_19005_2" clause="6.10" testNumber="2"/>
            <description>There shall be no PresSteps entry in any Page dictionary</description>
            <test>containsPresSteps == false</test>
            <error>
                <message>A Page dictionary contains the PresSteps entry</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_2" clause="6.11" testNumber="1"/>
            <description>The document catalog shall not contain the Requirements key</description>
            <test>Requirements == null</test>
            <error>
                <message>The document catalog contains the Requirements key</message>
                <arguments/>
            </error>
            <references/>
        </rule>
    </rules>
    <variables>
        <variable name="gOutputCS" object="ICCOutputProfile">
            <defaultValue>null</defaultValue>
            <value>S == "GTS_PDFA1" ? colorSpace : gOutputCS</value>
        </variable>
    </variables>
</profile>