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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="PDFA_1_B">
    <details creator="veraPDF Consortium" created="2017-09-06T13:12:20.277Z">
        <name>PDF/A-1b validation profile</name>
        <description>Validation rules against ISO 19005-1:2005, Cor.1:2007 and Cor.2:2011, Level B</description>
    </details>
    <hash></hash>
    <rules>
        <rule object="CosDocument">
            <id specification="ISO_19005_1" clause="6.1.2" testNumber="1"/>
            <description>The % character of the file header shall occur at byte offset 0 of the file. The first line of a PDF file is a header identifying the version of the PDF specification to which the file conforms</description>
            <test>headerOffset == 0 &amp;&amp; /%PDF-\d\.\d/.test(header)</test>
            <error>
                <message>File header %1 (offset = %2) starts at non-zero offset or does not match the pattern %PDF-n.m</message>
                <arguments>
                    <argument>header</argument>
                    <argument>headerOffset</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="3.4.1"/>
            </references>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_1" clause="6.1.2" testNumber="2"/>
            <description>The file header line shall be immediately followed by a comment consisting of a % character followed by at least four characters, 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_1" clause="6.1.3" testNumber="1"/>
            <description>The file trailer dictionary shall contain the ID keyword. The file trailer referred to is either the last trailer dictionary in a PDF file, as described in PDF Reference 3.4.4 and 3.4.5, or the first page trailer in a linearized PDF file, as described in PDF Reference F.2</description>
            <test>(isLinearized == true) ? (firstPageID != null) : (lastID != null)</test>
            <error>
                <message>Missing ID in the document trailer</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosTrailer">
            <id specification="ISO_19005_1" 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_1" clause="6.1.3" testNumber="3"/>
            <description>No data shall follow the last end-of-file marker except a single optional end-of-line marker</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/>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_1" clause="6.1.3" testNumber="4"/>
            <description>In a linearized PDF, if the ID keyword is present in both the first page trailer dictionary and the last trailer dictionary, the value to both instances of the ID keyword shall be identical</description>
            <test>(isLinearized != true) || lastID == null || (firstPageID == lastID)</test>
            <error>
                <message>Last ID (%1) is present in the Linearized PDF and does not match the first page ID (%2)</message>
                <arguments>
                    <argument>lastIDValue</argument>
                    <argument>firstPageIDValue</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.1.3"/>
            </references>
        </rule>
        <rule object="CosXRef">
            <id specification="ISO_19005_1" clause="6.1.4" testNumber="1"/>
            <description>In a cross reference subsection header the starting object number and the range shall be separated by a single SPACE character (20h)</description>
            <test>subsectionHeaderSpaceSeparated == true</test>
            <error>
                <message>Extra or missing spacings around in a subsection header of the cross reference table</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosXRef">
            <id specification="ISO_19005_1" 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="PDDocument">
            <id specification="ISO_19005_1" clause="6.1.4" testNumber="3"/>
            <description>Xref streams shall not be used</description>
            <test>containsXRefStream == false</test>
            <error>
                <message>The document uses xref streams</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosString">
            <id specification="ISO_19005_1" 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_1" clause="6.1.6" testNumber="2"/>
            <description>All non-white-space characters in hexadecimal strings shall be in the range 0 to 9, A to F or a to 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_1" clause="6.1.7" 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 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_1" clause="6.1.7" 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 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_1" clause="6.1.7" testNumber="3"/>
            <description>A stream object 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>
                <reference specification="19005-1:2005/Cor.2:2011" clause="6.1.7"/>
            </references>
        </rule>
        <rule object="CosIndirect">
            <id specification="ISO_19005_1" clause="6.1.8" 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="CosFilter">
            <id specification="ISO_19005_1" clause="6.1.10" testNumber="1"/>
            <description>The LZWDecode filter shall not be permitted</description>
            <test>internalRepresentation != "LZWDecode"</test>
            <error>
                <message>Unknown or not permitted Stream filter %1 is used</message>
                <arguments>
                    <argument>internalRepresentation</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="CosIIFilter">
            <id specification="ISO_19005_1" clause="6.1.10" testNumber="2"/>
            <description>The LZWDecode filter shall not be permitted</description>
            <test>internalRepresentation != "LZWDecode" &amp;&amp; internalRepresentation != "LZW"</test>
            <error>
                <message>LZW compression is used in the inline image</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosFileSpecification">
            <id specification="ISO_19005_1" clause="6.1.11" testNumber="1"/>
            <description>A file specification dictionary, as defined in PDF 3.10.2, shall not contain the EF key</description>
            <test>containsEF == false</test>
            <error>
                <message>A file specification dictionary contains the EF key</message>
                <arguments/>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="3.10.2"/>
            </references>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_1" clause="6.1.11" testNumber="2"/>
            <description>A file's name dictionary, as defined in PDF Reference 3.6.3, shall not contain the EmbeddedFiles key</description>
            <test>containsEmbeddedFiles == false</test>
            <error>
                <message>The document contains embedded files (EmbeddedFiles key is present in the file's name dictionary)</message>
                <arguments/>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="3.6.3"/>
            </references>
        </rule>
        <rule object="CosInteger">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="1"/>
            <description>Largest Integer value is 2,147,483,647. Smallest integer value is -2,147,483,648</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>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="CosReal">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="2"/>
            <description>Absolute real value must be less than or equal to 32767.0</description>
            <test>(realValue &gt;= -32767.0) &amp;&amp; (realValue &lt;= 32767.0)</test>
            <error>
                <message>Real value %1 out of range</message>
                <arguments>
                    <argument>realValue</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="CosString">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="3"/>
            <description>Maximum length of a string (in bytes) is 65535</description>
            <test>value.length() &lt; 65536</test>
            <error>
                <message>String length (%1) exceeded 65535</message>
                <arguments>
                    <argument>value.length()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="CosName">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="4"/>
            <description>Maximum length of a name (in bytes) is 127</description>
            <test>internalRepresentation.length() &lt;= 127</test>
            <error>
                <message>Name length (%1) exceeded 127</message>
                <arguments>
                    <argument>internalRepresentation.length()</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="CosArray">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="5"/>
            <description>Maximum capacity of an array (in elements) is 8191</description>
            <test>size &lt;= 8191</test>
            <error>
                <message>Array capacity (%1) exceeded 8191</message>
                <arguments>
                    <argument>size</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="CosDict">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="6"/>
            <description>Maximum capacity of a dictionary (in entries) is 4095</description>
            <test>size &lt;= 4095</test>
            <error>
                <message>Dictionary capacity (%1) exceeded 4095</message>
                <arguments>
                    <argument>size</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="7"/>
            <description>Maximum number of indirect objects in a PDF file is 8,388,607</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>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="Op_q_gsave">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="8"/>
            <description>Maximum depth of graphics state nesting by q and Q operators is 28</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>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="PDDeviceN">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="9"/>
            <description>Maximum number of DeviceN components is 8</description>
            <test>nrComponents &lt;= 8</test>
            <error>
                <message>Number of DeviceN components (%1) exceeded 8</message>
                <arguments>
                    <argument>nrComponents</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="CMapFile">
            <id specification="ISO_19005_1" clause="6.1.12" testNumber="10"/>
            <description>Maximum value of a CID (character identifier) is 65,535</description>
            <test>maximalCID &lt;= 65535</test>
            <error>
                <message>Value of a CID (%1) exceeded 65,535</message>
                <arguments>
                    <argument>maximalCID</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF Reference 1.4" clause="Table C.1"/>
            </references>
        </rule>
        <rule object="CosDocument">
            <id specification="ISO_19005_1" clause="6.1.13" testNumber="1"/>
            <description>The document catalog dictionary shall not contain a key with the name OCProperties</description>
            <test>isOptionalContentPresent == false</test>
            <error>
                <message>The document catalog dictionary contains the OCProperties entry</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="ICCOutputProfile">
            <id specification="ISO_19005_1" clause="6.2.2" testNumber="1"/>
            <description>A PDF/A-1 OutputIntent is an OutputIntent dictionary, as defined by PDF Reference 9.10.4, that is included in the file's OutputIntents array and has GTS_PDFA1 as the value of its S key and a valid ICC profile stream as the value its DestOutputProfile key</description>
            <test>(deviceClass == "prtr" || deviceClass == "mntr") &amp;&amp; (colorSpace == "RGB " || colorSpace == "CMYK" || colorSpace == "GRAY") &amp;&amp; version &lt; 3.0</test>
            <error>
                <message>The embedded PDF/A Output Intent colour profile is either invalid or does not provide BToA information</message>
                <arguments/>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="9.10.4"/>
            </references>
        </rule>
        <rule object="OutputIntents">
            <id specification="ISO_19005_1" clause="6.2.2" testNumber="2"/>
            <description>If a file's OutputIntents array contains more than one entry, 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="ICCInputProfile">
            <id specification="ISO_19005_1" clause="6.2.3.2" testNumber="1"/>
            <description>All ICCBased colour spaces shall be embedded as ICC profile streams as described in PDF Reference 4.5</description>
            <test>(deviceClass == "prtr" || deviceClass == "mntr" || deviceClass == "scnr" || deviceClass == "spac") &amp;&amp; (colorSpace == "RGB " || colorSpace == "CMYK" || colorSpace == "GRAY" || colorSpace == "Lab ") &amp;&amp; version &lt; 3.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.4 requirements</message>
                <arguments>
                    <argument>deviceClass</argument>
                    <argument>colorSpace</argument>
                    <argument>version</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="4.5.4, ICCBased Color Spaces"/>
            </references>
        </rule>
        <rule object="ICCProfile">
            <id specification="ISO_19005_1" clause="6.2.3.2" testNumber="2"/>
            <description>All ICCBased colour spaces shall be embedded as ICC profile streams as described in PDF Reference 4.5. The number of color components in the color space described by the ICC profile data must match the number of components actually in the ICC profile. As of PDF 1.4, N must be 1, 3, or 4</description>
            <test>N != null &amp;&amp; ((N == 1 &amp;&amp; colorSpace == "GRAY") || (N == 3 &amp;&amp; (colorSpace == "RGB " || colorSpace == "Lab ")) || (N == 4 &amp;&amp; colorSpace == "CMYK"))</test>
            <error>
                <message>The N entry (value %1) in the ICC profile dictionary is missing or does not match the number of components in the embedded ICC profile (color space %2)</message>
                <arguments>
                    <argument>N</argument>
                    <argument>colorSpace</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="4.5.4, Table 4.16"/>
            </references>
        </rule>
        <rule object="PDDeviceRGB">
            <id specification="ISO_19005_1" clause="6.2.3.3" testNumber="1"/>
            <description>DeviceRGB may be used only if the file has a PDF/A-1 OutputIntent that uses an RGB colour space</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_1" clause="6.2.3.3" testNumber="2"/>
            <description>DeviceCMYK may be used only if the file has a PDF/A-1 OutputIntent that uses a CMYK colour space</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_1" clause="6.2.3.3" testNumber="3"/>
            <description>If an uncalibrated colour space is used in a file then that file shall contain a PDF/A-1 OutputIntent, as defined in 6.2.2</description>
            <test>gOutputCS != null</test>
            <error>
                <message>DeviceGray colour space is used without output intent profile</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXImage">
            <id specification="ISO_19005_1" clause="6.2.4" 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="PDXObject">
            <id specification="ISO_19005_1" clause="6.2.4" testNumber="2"/>
            <description>An XObject dictionary (Image or Form) shall not contain the OPI key</description>
            <test>containsOPI == false</test>
            <error>
                <message>OPI key is present in the XObject dictionary</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXImage">
            <id specification="ISO_19005_1" clause="6.2.4" testNumber="3"/>
            <description>If an Image dictionary contains the Interpolate key, its value shall be 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_1" clause="6.2.4" testNumber="4"/>
            <description>If an Image dictionary contains the BitsPerComponent key, its value shall be 1, 2, 4 or 8</description>
            <test>isMask == true || BitsPerComponent == null || BitsPerComponent == 1 || BitsPerComponent == 2 || BitsPerComponent == 4 || BitsPerComponent == 8</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="PDF 1.4 Reference" clause="4.8.4, Table 4.35"/>
            </references>
        </rule>
        <rule object="PDMaskImage">
            <id specification="ISO_19005_1" clause="6.2.4" 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="PDF 1.4 Reference" clause="4.8.4, Table 4.35"/>
            </references>
        </rule>
        <rule object="PDXForm">
            <id specification="ISO_19005_1" clause="6.2.5" testNumber="1"/>
            <description>A form XObject dictionary shall not contain the Subtype2 key with a value of PS or the PS key</description>
            <test>(Subtype2 == null || Subtype2 != "PS") &amp;&amp; containsPS == false</test>
            <error>
                <message>The form XObject dictionary contains a PS key or Subtype2 key with value PS</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXForm">
            <id specification="ISO_19005_1" clause="6.2.6" testNumber="1"/>
            <description>A conforming file shall not contain any reference XObjects</description>
            <test>containsRef == false</test>
            <error>
                <message>The document contains a reference XObject (Ref key in the form XObject dictionary)</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXObject">
            <id specification="ISO_19005_1" clause="6.2.7" testNumber="1"/>
            <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="PDExtGState">
            <id specification="ISO_19005_1" clause="6.2.8" 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_1" clause="6.2.8" 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="CosRenderingIntent">
            <id specification="ISO_19005_1" clause="6.2.9" testNumber="1"/>
            <description>Where a rendering intent is specified, its value shall be one of the four values defined in PDF Reference 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="Op_Undefined">
            <id specification="ISO_19005_1" clause="6.2.10" testNumber="1"/>
            <description>A content stream shall not contain any operators not defined in PDF Reference 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 PDF Reference</message>
                <arguments>
                    <argument>name</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFont">
            <id specification="ISO_19005_1" clause="6.3.2" testNumber="1"/>
            <description>All fonts used in a conforming file shall conform to the font specifications defined in PDF Reference 5.5. 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="PDF 1.4 Reference" clause="5.5.1 - Table 5.8"/>
                <reference specification="PDF 1.4 Reference" clause="5.5.4 - Table 5.9"/>
                <reference specification="PDF 1.4 Reference" clause="5.6.3 - Table 5.13"/>
                <reference specification="PDF 1.4 Reference" clause="5.6.5 - Table 5.17"/>
            </references>
        </rule>
        <rule object="PDFont">
            <id specification="ISO_19005_1" clause="6.3.2" testNumber="2"/>
            <description>All fonts used in a conforming file shall conform to the font specifications defined in PDF Reference 5.5. 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="PDF 1.4 Reference" clause="5.5.1 - Table 5.8"/>
                <reference specification="PDF 1.4 Reference" clause="5.5.4 - Table 5.9"/>
                <reference specification="PDF 1.4 Reference" clause="5.6.3 - Table 5.13"/>
                <reference specification="PDF 1.4 Reference" clause="5.6.5 - Table 5.17"/>
            </references>
        </rule>
        <rule object="PDFont">
            <id specification="ISO_19005_1" clause="6.3.2" testNumber="3"/>
            <description>All fonts used in a conforming file shall conform to the font specifications defined in PDF Reference 5.5. 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="PDF 1.4 Reference" clause="5.5.1 - Table 5.8"/>
                <reference specification="PDF 1.4 Reference" clause="5.5.4 - Table 5.9"/>
                <reference specification="PDF 1.4 Reference" clause="5.6.3 - Table 5.13"/>
                <reference specification="PDF 1.4 Reference" clause="5.6.5 - Table 5.17"/>
            </references>
        </rule>
        <rule object="PDSimpleFont">
            <id specification="ISO_19005_1" clause="6.3.2" testNumber="4"/>
            <description>All fonts used in a conforming file shall conform to the font specifications defined in PDF Reference 5.5. 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="PDF 1.4 Reference" clause="5.5.1 - Table 5.8"/>
                <reference specification="PDF 1.4 Reference" clause="5.5.4 - Table 5.9"/>
            </references>
        </rule>
        <rule object="PDSimpleFont">
            <id specification="ISO_19005_1" clause="6.3.2" testNumber="5"/>
            <description>All fonts used in a conforming file shall conform to the font specifications defined in PDF Reference 5.5. 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="PDF 1.4 Reference" clause="5.5.1 - Table 5.8"/>
                <reference specification="PDF 1.4 Reference" clause="5.5.4 - Table 5.9"/>
            </references>
        </rule>
        <rule object="PDSimpleFont">
            <id specification="ISO_19005_1" clause="6.3.2" testNumber="6"/>
            <description>All fonts used in a conforming file shall conform to the font specifications defined in PDF Reference 5.5. 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="PDF 1.4 Reference" clause="5.5.1 - Table 5.8"/>
                <reference specification="PDF 1.4 Reference" clause="5.5.4 - Table 5.9"/>
            </references>
        </rule>
        <rule object="PDFont">
            <id specification="ISO_19005_1" clause="6.3.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.4 are Type1C - Type 1–equivalent font program represented in the Compact Font Format (CFF) and CIDFontType0C - Type 0 CIDFont program represented in the Compact Font Format (CFF)</description>
            <test>fontFileSubtype == null || fontFileSubtype == "Type1C" || fontFileSubtype == "CIDFontType0C"</test>
            <error>
                <message>Unsupported font file format %1 of the embedded font</message>
                <arguments>
                    <argument>fontFileSubtype</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="5.8 - Table 5.22"/>
                <reference specification="Adobe Technical Note #5176, The Compact Font Format Specification" clause=""/>
            </references>
        </rule>
        <rule object="PDType0Font">
            <id specification="ISO_19005_1" clause="6.3.3.1" testNumber="1"/>
            <description>For any given composite (Type 0) font referenced within a conforming file, the CIDSystemInfo entries of its CIDFont and CMap dictionaries shall be compatible. In other words, the Registry and Ordering strings of the CIDSystemInfo dictionaries for that font shall be identical, unless the value of the Encoding key in the font dictionary is Identity-H or Identity-V</description>
            <test>cmapName == "Identity-H" || cmapName == "Identity-V" || (CIDFontOrdering != null &amp;&amp; CIDFontOrdering == CMapOrdering &amp;&amp; CIDFontRegistry != null &amp;&amp; CIDFontRegistry == CMapRegistry)</test>
            <error>
                <message>Registry and Ordering entries in 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)</message>
                <arguments>
                    <argument>CIDFontOrdering</argument>
                    <argument>CMapOrdering</argument>
                    <argument>CIDFontRegistry</argument>
                    <argument>CMapRegistry</argument>
                </arguments>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="5.6.2"/>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.3.3"/>
            </references>
        </rule>
        <rule object="PDCIDFont">
            <id specification="ISO_19005_1" clause="6.3.3.2" testNumber="1"/>
            <description>For all Type 2 CIDFonts that are used for rendering, 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 PDF Reference Table 5.13</description>
            <test>Subtype != "CIDFontType2" || CIDToGIDMap != null || renderingMode == 3</test>
            <error>
                <message>A Type 2 CIDFont dictionary has missing or invalid CIDToGIDMap entry</message>
                <arguments/>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="5.6.3 - Table 5.13"/>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.3.3"/>
            </references>
        </rule>
        <rule object="PDCMap">
            <id specification="ISO_19005_1" clause="6.3.3.3" testNumber="1"/>
            <description>All CMaps used within a conforming file, except Identity-H and Identity-V, shall be embedded in that file as described in PDF Reference 5.6.4</description>
            <test>CMapName == "Identity-H" || CMapName == "Identity-V" || containsEmbeddedFile == true</test>
            <error>
                <message>A CMap is different from "Identity-H" or "Identity-V" and is not embedded</message>
                <arguments/>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="5.6.4"/>
            </references>
        </rule>
        <rule object="CMapFile">
            <id specification="ISO_19005_1" clause="6.3.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="PDFont">
            <id specification="ISO_19005_1" clause="6.3.4" testNumber="1"/>
            <description>The font programs for all fonts used within a conforming file shall be embedded within that file, as defined in PDF Reference 5.8, except when the fonts are used exclusively with text rendering mode 3</description>
            <test>Subtype == "Type3" || Subtype == "Type0" || renderingMode == 3 || containsFontFile == true</test>
            <error>
                <message>The font program is not embedded</message>
                <arguments/>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="5.8"/>
            </references>
        </rule>
        <rule object="Glyph">
            <id specification="ISO_19005_1" clause="6.3.5" testNumber="1"/>
            <description>Embedded font programs shall define all font glyphs referenced for rendering with conforming file</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/>
        </rule>
        <rule object="PDType1Font" deferred="true">
            <id specification="ISO_19005_1" clause="6.3.5" testNumber="2"/>
            <description>For all Type 1 font subsets referenced within a conforming file, the font descriptor dictionary shall include a CharSet string listing the character names defined in the font subset, as described in PDF Reference Table 5.18</description>
            <test>fontName.search(/[A-Z]{6}\+/) != 0 || (CharSet != null &amp;&amp; charSetListsAllGlyphs == true)</test>
            <error>
                <message>A Type1 font subset does not define CharSet entry in its Descriptor dictionary</message>
                <arguments/>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="5.5.3"/>
            </references>
        </rule>
        <rule object="PDCIDFont" deferred="true">
            <id specification="ISO_19005_1" clause="6.3.5" testNumber="3"/>
            <description>For all CIDFont subsets referenced within a conforming file, the font descriptor dictionary shall include a CIDSet stream identifying which CIDs are present in the embedded CIDFont file, as described in PDF Reference Table 5.20</description>
            <test>fontName.search(/[A-Z]{6}\+/) != 0 || (containsCIDSet == true &amp;&amp; cidSetListsAllGlyphs == true)</test>
            <error>
                <message>A CIDSet entry in the Font descriptor is missing or does not correctly identify all glyphs present in the embedded font subset and used for rendering</message>
                <arguments/>
            </error>
            <references>
                <reference specification="PDF 1.4 Reference" clause="5.5.3"/>
            </references>
        </rule>
        <rule object="Glyph">
            <id specification="ISO_19005_1" clause="6.3.6" 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>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.3.6"/>
            </references>
        </rule>
        <rule object="PDTrueTypeFont">
            <id specification="ISO_19005_1" clause="6.3.7" testNumber="1"/>
            <description>All non-symbolic TrueType fonts shall specify MacRomanEncoding or WinAnsiEncoding, either as the value of the Encoding entry in the font dictionary or as the value of the BaseEncoding entry in the dictionary that is the value of the Encoding entry in the font dictionary. If the value of the Encoding entry is a dictionary, it shall not contain a Differences entry</description>
            <test>isSymbolic == true || ((Encoding == "MacRomanEncoding" || Encoding == "WinAnsiEncoding") &amp;&amp; containsDifferences == false)</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)</message>
                <arguments>
                    <argument>Encoding</argument>
                    <argument>containsDifferences</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.3.7"/>
            </references>
        </rule>
        <rule object="PDTrueTypeFont">
            <id specification="ISO_19005_1" clause="6.3.7" testNumber="2"/>
            <description>All symbolic TrueType fonts shall not specify 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>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.3.7"/>
            </references>
        </rule>
        <rule object="TrueTypeFontProgram">
            <id specification="ISO_19005_1" clause="6.3.7" testNumber="3"/>
            <description>Font programs' "cmap" tables for all symbolic TrueType fonts shall contain exactly one encoding</description>
            <test>isSymbolic == false || nrCmaps == 1</test>
            <error>
                <message>The embedded font program for a symbolic TrueType font contains %1 cmap subtables</message>
                <arguments>
                    <argument>nrCmaps</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.3.7"/>
            </references>
        </rule>
        <rule object="PDExtGState">
            <id specification="ISO_19005_1" clause="6.4" testNumber="1"/>
            <description>If an SMask key appears in an ExtGState dictionary, its value shall be None</description>
            <test>containsSMask == false || SMaskNameValue == "None"</test>
            <error>
                <message>An ExtGState contains SMask key with a value other than None</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDXObject">
            <id specification="ISO_19005_1" clause="6.4" testNumber="2"/>
            <description>An XObject dictionary shall not contain the SMask key</description>
            <test>containsSMask == false</test>
            <error>
                <message>An XObject contains an SMask key</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.4"/>
            </references>
        </rule>
        <rule object="PDGroup">
            <id specification="ISO_19005_1" clause="6.4" testNumber="3"/>
            <description>A Group object with an S key with a value of Transparency shall not be included in a form XObject. A Group object with an S key with a value of Transparency shall not be included in a page dictionary</description>
            <test>S != "Transparency"</test>
            <error>
                <message>A transparency group is present in a form XObject or page dictionary</message>
                <arguments/>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.2:2011" clause="6.4"/>
            </references>
        </rule>
        <rule object="PDExtGState">
            <id specification="ISO_19005_1" clause="6.4" testNumber="4"/>
            <description>If a BM key is present in an ExtGState object, its value shall be Normal or Compatible</description>
            <test>containsBM == false || BMNameValue == "Normal" || BMNameValue == "Compatible"</test>
            <error>
                <message>An ExtGState dictionary contains the BM key (blend mode) with value %1 that is neither Normal or Compatible</message>
                <arguments>
                    <argument>BMNameValue</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDExtGState">
            <id specification="ISO_19005_1" clause="6.4" testNumber="5"/>
            <description>If a CA key is present in an ExtGState object, its value shall be 1.0</description>
            <test>CA == null || CA - 1.0 &lt; 0.000001 &amp;&amp; CA - 1.0 &gt; -0.000001</test>
            <error>
                <message>An ExtGState dictionary contains the CA key (stroke alpha) with value %1 other than 1.0</message>
                <arguments>
                    <argument>CA</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDExtGState">
            <id specification="ISO_19005_1" clause="6.4" testNumber="6"/>
            <description>If a ca key is present in an ExtGState object, its value shall be 1.0</description>
            <test>ca == null || ca - 1.0 &lt; 0.000001 &amp;&amp; ca - 1.0 &gt; -0.000001</test>
            <error>
                <message>An ExtGState dictionary contains the ca key (fill alpha) with value %1 other than 1.0</message>
                <arguments>
                    <argument>ca</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_1" clause="6.5.2" testNumber="1"/>
            <description>Annotation types not defined in PDF Reference shall not be permitted. Additionally, the FileAttachment, Sound and Movie types shall not be permitted</description>
            <test>Subtype == "Text" || Subtype == "Link" || Subtype == "FreeText" || Subtype == "Line" || Subtype == "Square" || Subtype == "Circle" || Subtype == "Highlight" || Subtype == "Underline" || Subtype == "Squiggly" || Subtype == "StrikeOut" || Subtype == "Stamp" || Subtype == "Ink" || Subtype == "Popup" || Subtype == "Widget" || Subtype == "PrinterMark" || Subtype == "TrapNet"</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="8.4.5"/>
            </references>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_1" clause="6.5.3" testNumber="1"/>
            <description>An annotation dictionary shall not contain the CA key with a value other than 1.0</description>
            <test>CA == null || CA == 1.0</test>
            <error>
                <message>An annotation dictionary contains the CA key with value %1 instead of 1.0</message>
                <arguments>
                    <argument>CA</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_1" clause="6.5.3" testNumber="2"/>
            <description>An annotation dictionary shall contain the F key. The F key’s Print flag bit shall be set to 1 and its Hidden, Invisible and NoView flag bits shall be set to 0</description>
            <test>F != null &amp;&amp; (F &amp; 4) == 4 &amp;&amp; (F &amp; 1) == 0 &amp;&amp; (F &amp; 2) == 0 &amp;&amp; (F &amp; 32) == 0</test>
            <error>
                <message>Annotation flags are either missing or set the annotation to be hidden/invisible or non-printable (F = %1, Print = %2, Hidden = %3, Invisible = %4, NoView = %5)</message>
                <arguments>
                    <argument>F</argument>
                    <argument>F != null ? (F &amp; 4) &gt;&gt; 2 : null</argument>
                    <argument>F != null ? (F &amp; 2) &gt;&gt; 1 : null</argument>
                    <argument>F != null ? (F &amp; 1) : null</argument>
                    <argument>F != null ? (F &amp; 32) &gt;&gt; 5 : null</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_1" clause="6.5.3" testNumber="3"/>
            <description>An annotation dictionary shall not contain the C array or the IC array unless the colour space of the DestOutputProfile in the PDF/A-1 OutputIntent dictionary, defined in 6.2.2, is RGB</description>
            <test>(containsC == false &amp;&amp; containsIC == false) || gOutputCS == "RGB "</test>
            <error>
                <message>Annotation's color (C present = %1) or interior color (IC present = %2) is used without specifying RGB-based destination output profile</message>
                <arguments>
                    <argument>containsC</argument>
                    <argument>containsIC</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_1" clause="6.5.3" testNumber="4"/>
            <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>
                <reference specification="ISO 19005-1/Cor.2:2011" clause="6.5.3"/>
            </references>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_1" clause="6.5.3" testNumber="5"/>
            <description>If an annotation dictionary's Subtype key has a value of Widget and its FT key has a value of Btn, the value of the N key shall be an appearance subdictionary</description>
            <test>AP != "N" || Subtype != "Widget" || FT != "Btn" || (N_type == "Dict" &amp;&amp; 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>
                <reference specification="ISO 19005-1/Cor.2:2011" clause="6.5.3"/>
            </references>
        </rule>
        <rule object="PDAnnot">
            <id specification="ISO_19005_1" clause="6.5.3" testNumber="6"/>
            <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>
                <reference specification="ISO 19005-1/Cor.2:2011" clause="6.5.3"/>
            </references>
        </rule>
        <rule object="PDAction">
            <id specification="ISO_19005_1" clause="6.6.1" testNumber="1"/>
            <description>The Launch, Sound, Movie, ResetForm, ImportData and JavaScript actions shall not be permitted. Additionally, the deprecated set-state and no-op actions shall not be permitted. The Hide action shall not be permitted (Corrigendum 2)</description>
            <test>S == "GoTo" || S == "GoToR" || 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 19005-1:2005/Cor.2:2011" clause="6.6.1"/>
            </references>
        </rule>
        <rule object="PDNamedAction">
            <id specification="ISO_19005_1" clause="6.6.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="PDF 1.4 Reference" clause="8.5.3 - Named Actions - Table 8.45"/>
            </references>
        </rule>
        <rule object="PDWidgetAnnot">
            <id specification="ISO_19005_1" clause="6.6.1" testNumber="3"/>
            <description>Interactive form fields shall not perform actions of any type</description>
            <test>containsA == false</test>
            <error>
                <message>Interactive form field contains an action object ('A' key)</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDWidgetAnnot">
            <id specification="ISO_19005_1" clause="6.6.2" testNumber="1"/>
            <description>A Widget annotation dictionary shall not include an AA entry for an additional-actions dictionary</description>
            <test>containsAA == false</test>
            <error>
                <message>A Widget annotation contains an additional-actions dictionary (AA entry)</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDFormField">
            <id specification="ISO_19005_1" clause="6.6.2" testNumber="2"/>
            <description>A Field dictionary shall not include an AA entry for an additional-actions dictionary</description>
            <test>containsAA == false</test>
            <error>
                <message>A Field dictionary contains an additional-actions dictionary (AA entry)</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="PDDocument">
            <id specification="ISO_19005_1" clause="6.6.2" testNumber="3"/>
            <description>The document catalog dictionary 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="PDDocument">
            <id specification="ISO_19005_1" clause="6.7.2" testNumber="1"/>
            <description>The document catalog dictionary of a conforming file shall contain the Metadata key. The metadata stream dictionary shall contain entry Type with value /Metadata and entry Subtype with value /XML</description>
            <test>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/>
        </rule>
        <rule object="PDMetadata">
            <id specification="ISO_19005_1" clause="6.7.2" testNumber="2"/>
            <description>The Metadata object stream dictionary in the document’s catalog shall not contain the Filter key</description>
            <test>isCatalogMetadata == false || Filter == null</test>
            <error>
                <message>The catalog metadata object stream dictionary contains the Filter key</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="CosInfo">
            <id specification="ISO_19005_1" clause="6.7.3" testNumber="1"/>
            <description>The value of CreationDate entry from the document information dictionary, if present, and its analogous XMP property "xmp:CreateDate" shall be equivalent</description>
            <test>doCreationDatesMatch != false</test>
            <error>
                <message>The value of CreationDate entry from the document Info dictionary and its matching XMP property "xmp:CreateDate" are not equivalent (Info /CreationDate = %1, XMP xmp:CreateDate = %2)</message>
                <arguments>
                    <argument>CreationDate</argument>
                    <argument>XMPCreateDate</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.1:2007/Cor.2:2011" clause="6.7.3"/>
            </references>
        </rule>
        <rule object="CosInfo">
            <id specification="ISO_19005_1" clause="6.7.3" testNumber="2"/>
            <description>The value of Title entry from the document information dictionary, if present, and its analogous XMP property "dc:title['x-default']" shall be equivalent</description>
            <test>Title == null || Title == XMPTitle</test>
            <error>
                <message>The value of Title entry from the document Info dictionary and its matching XMP property "dc:title['x-default']" are not equivalent (Info /Title = %1, XMP dc:title['x-default'] = %2)</message>
                <arguments>
                    <argument>Title</argument>
                    <argument>XMPTitle</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.1:2007/Cor.2:2011" clause="6.7.3"/>
            </references>
        </rule>
        <rule object="CosInfo">
            <id specification="ISO_19005_1" clause="6.7.3" testNumber="3"/>
            <description>The value of Author entry from the document information dictionary, if present, and its analogous XMP property "dc:creator" shall be equivalent. dc:creator shall contain exactly one entry</description>
            <test>Author == null || (Author == XMPCreator &amp;&amp; XMPCreatorSize == 1)</test>
            <error>
                <message>The value of Author entry from the document Info dictionary and its matching XMP property "dc:creator" are not equivalent (Info /Author = %1, XMP dc:creator = %2)</message>
                <arguments>
                    <argument>Author</argument>
                    <argument>XMPCreator</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.1:2007/Cor.2:2011" clause="6.7.3"/>
            </references>
        </rule>
        <rule object="CosInfo">
            <id specification="ISO_19005_1" clause="6.7.3" testNumber="4"/>
            <description>The value of Subject entry from the document information dictionary, if present, and its analogous XMP property "dc:description['x-default']" shall be equivalent</description>
            <test>Subject == null || Subject == XMPDescription</test>
            <error>
                <message>The value of Subject entry from the document Info dictionary and its matching XMP property "dc:description['x-default']" are not equivalent (Info /Subject = %1, XMP dc:description['x-default'] = %2)</message>
                <arguments>
                    <argument>Subject</argument>
                    <argument>XMPDescription</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.1:2007/Cor.2:2011" clause="6.7.3"/>
            </references>
        </rule>
        <rule object="CosInfo">
            <id specification="ISO_19005_1" clause="6.7.3" testNumber="5"/>
            <description>The value of Keywords entry from the document information dictionary, if present, and its analogous XMP property "pdf:Keywords" shall be equivalent</description>
            <test>Keywords == null || Keywords == XMPKeywords</test>
            <error>
                <message>The value of Keywords entry from the document Info dictionary and its matching XMP property "pdf:Keywords" are not equivalent (Info /Keywords = %1, XMP pdf:Keywords = %2)</message>
                <arguments>
                    <argument>Keywords</argument>
                    <argument>XMPKeywords</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.1:2007/Cor.2:2011" clause="6.7.3"/>
            </references>
        </rule>
        <rule object="CosInfo">
            <id specification="ISO_19005_1" clause="6.7.3" testNumber="6"/>
            <description>The value of Creator entry from the document information dictionary, if present, and its analogous XMP property "xmp:CreatorTool" shall be equivalent</description>
            <test>Creator == null || Creator == XMPCreatorTool</test>
            <error>
                <message>The value of Creator entry from the document Info dictionary and its matching XMP property "xmp:CreatorTool" are not equivalent (Info /Creator = %1, XMP xmp:CreatorTool = %2)</message>
                <arguments>
                    <argument>Creator</argument>
                    <argument>XMPCreatorTool</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.1:2007/Cor.2:2011" clause="6.7.3"/>
            </references>
        </rule>
        <rule object="CosInfo">
            <id specification="ISO_19005_1" clause="6.7.3" testNumber="7"/>
            <description>The value of Producer entry from the document information dictionary, if present, and its analogous XMP property "pdf:Producer" shall be equivalent</description>
            <test>Producer == null || Producer == XMPProducer</test>
            <error>
                <message>The value of Producer entry from the document Info dictionary and its matching XMP property "pdf:Producer" are not equivalent (Info /Producer = %1, XMP pdf:Producer = %2)</message>
                <arguments>
                    <argument>Producer</argument>
                    <argument>XMPProducer</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.1:2007/Cor.2:2011" clause="6.7.3"/>
            </references>
        </rule>
        <rule object="CosInfo">
            <id specification="ISO_19005_1" clause="6.7.3" testNumber="8"/>
            <description>The value of ModDate entry from the document information dictionary, if present, and its analogous XMP property "xmp:ModifyDate" shall be equivalent</description>
            <test>doModDatesMatch != false</test>
            <error>
                <message>The value of ModDate entry from the document Info dictionary and its matching XMP property "xmp:ModifyDate" are not equivalent (Info /ModDate = %1, XMP xmp:ModifyDate = %2)</message>
                <arguments>
                    <argument>ModDate</argument>
                    <argument>XMPModifyDate</argument>
                </arguments>
            </error>
            <references>
                <reference specification="ISO 19005-1:2005/Cor.1:2007/Cor.2:2011" clause="6.7.3"/>
            </references>
        </rule>
        <rule object="XMPPackage">
            <id specification="ISO_19005_1" clause="6.7.5" testNumber="1"/>
            <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_1" clause="6.7.5" testNumber="2"/>
            <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="ExtensionSchemaObject">
            <id specification="ISO_19005_1" clause="6.7.8" testNumber="1"/>
            <description>Extension schema descriptions shall be specified using the PDF/A extension schema description schema defined in this clause</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>
                <reference specification="ISO 19005-1:2005/Cor.1:2007" clause="6.7.8"/>
            </references>
        </rule>
        <rule object="ExtensionSchemasContainer">
            <id specification="ISO_19005_1" clause="6.7.8" testNumber="2"/>
            <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>
                <reference specification="ISO 19005-1:2005/Cor.1:2007" clause="6.7.8"/>
            </references>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_1" clause="6.7.8" testNumber="3"/>
            <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>
                <reference specification="ISO 19005-1:2005/Cor.1:2007" clause="6.7.8"/>
            </references>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_1" clause="6.7.8" testNumber="4"/>
            <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>
                <reference specification="ISO 19005-1:2005/Cor.1:2007" clause="6.7.8"/>
            </references>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_1" clause="6.7.8" testNumber="5"/>
            <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>
                <reference specification="ISO 19005-1:2005/Cor.1:2007" clause="6.7.8"/>
            </references>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_1" clause="6.7.8" testNumber="6"/>
            <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>
                <reference specification="ISO 19005-1:2005/Cor.1:2007" clause="6.7.8"/>
            </references>
        </rule>
        <rule object="ExtensionSchemaDefinition">
            <id specification="ISO_19005_1" clause="6.7.8" testNumber="7"/>
            <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>
                <reference specification="ISO 19005-1:2005/Cor.1:2007" clause="6.7.8"/>
            </references>
        </rule>
        <rule object="ExtensionSchemaProperty">
            <id specification="ISO_19005_1" clause="6.7.8" testNumber="8"/>
            <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_1" clause="6.7.8" testNumber="9"/>
            <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_1" clause="6.7.8" testNumber="10"/>
            <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_1" clause="6.7.8" testNumber="11"/>
            <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_1" clause="6.7.8" testNumber="12"/>
            <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_1" clause="6.7.8" testNumber="13"/>
            <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_1" clause="6.7.8" testNumber="14"/>
            <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_1" clause="6.7.8" testNumber="15"/>
            <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_1" clause="6.7.8" testNumber="16"/>
            <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_1" clause="6.7.8" testNumber="17"/>
            <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_1" clause="6.7.8" testNumber="18"/>
            <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_1" clause="6.7.8" testNumber="19"/>
            <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="XMPPackage">
            <id specification="ISO_19005_1" clause="6.7.9" testNumber="1"/>
            <description>The metadata stream shall conform to XMP Specification and well formed PDFAExtension Schema for all extensions</description>
            <test>isSerializationValid</test>
            <error>
                <message>The serialization of the metadata stream does not conform to XMP Specification</message>
                <arguments/>
            </error>
            <references>
                <reference specification="XMP Specification January 2004" clause=""/>
            </references>
        </rule>
        <rule object="XMPProperty">
            <id specification="ISO_19005_1" clause="6.7.9" testNumber="2"/>
            <description>Properties specified in XMP form shall use either the predefined schemas defined in XMP Specification, or extension schemas that comply with XMP Specification</description>
            <test>isPredefinedInXMP2004 == true || isDefinedInCurrentPackage == true</test>
            <error>
                <message>A property is either not defined in XMP Specification, or is not defined in any of the extension schemas</message>
                <arguments/>
            </error>
            <references/>
        </rule>
        <rule object="XMPProperty">
            <id specification="ISO_19005_1" clause="6.7.9" testNumber="3"/>
            <description>Properties specified in XMP form shall use either the predefined schemas defined in XMP Specification, or extension schemas that comply with XMP Specification</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="MainXMPPackage">
            <id specification="ISO_19005_1" clause="6.7.11" testNumber="1"/>
            <description>The PDF/A version and conformance level of a file shall be specified using the PDF/A Identification extension schema</description>
            <test>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_1" clause="6.7.11" testNumber="2"/>
            <description>The value of "pdfaid:part" shall be the part number of ISO 19005 to which the file conforms</description>
            <test>part == 1</test>
            <error>
                <message>The "part" property of the PDF/A Identification Schema is %1 instead of 1 for PDF/A-1 conforming file</message>
                <arguments>
                    <argument>part</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFAIdentification">
            <id specification="ISO_19005_1" clause="6.7.11" 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</description>
            <test>conformance == "B" || conformance == "A"</test>
            <error>
                <message>The "conformance" property of the PDF/A Identification Schema is %1 instead of "B" for PDF/A-1b conforming file</message>
                <arguments>
                    <argument>conformance</argument>
                </arguments>
            </error>
            <references/>
        </rule>
        <rule object="PDFAIdentification">
            <id specification="ISO_19005_1" clause="6.7.11" 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_1" clause="6.7.11" 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_1" clause="6.7.11" 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="PDAcroForm">
            <id specification="ISO_19005_1" clause="6.9" testNumber="1"/>
            <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="PDWidgetAnnot">
            <id specification="ISO_19005_1" clause="6.9" testNumber="2"/>
            <description>Every form field shall have an appearance dictionary associated with the field's data</description>
            <test>AP != null</test>
            <error>
                <message>Form field does not have an appearance dictionary associated with the field's data</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>