@@ -152,6 +152,10 @@ public class DocumentRevisionsValidator {
152
152
internal const String PAGE_MODIFIED = "Page was unexpectedly modified." ;
153
153
//\endcond
154
154
155
+ //\cond DO_NOT_DOCUMENT
156
+ internal const String TABS_MODIFIED = "Tabs entry in a page dictionary was unexpectedly modified." ;
157
+ //\endcond
158
+
155
159
//\cond DO_NOT_DOCUMENT
156
160
internal const String PERMISSIONS_REMOVED = "Permissions dictionary was removed from the catalog." ;
157
161
//\endcond
@@ -1510,15 +1514,21 @@ private bool ComparePages(PdfDictionary prevPages, PdfDictionary currPages, Vali
1510
1514
previousPageCopy . Remove ( PdfName . Annots ) ;
1511
1515
previousPageCopy . Remove ( PdfName . Parent ) ;
1512
1516
previousPageCopy . Remove ( PdfName . StructParents ) ;
1517
+ previousPageCopy . Remove ( PdfName . Tabs ) ;
1513
1518
PdfDictionary currentPageCopy = new PdfDictionary ( currentKid ) ;
1514
1519
currentPageCopy . Remove ( PdfName . Annots ) ;
1515
1520
currentPageCopy . Remove ( PdfName . Parent ) ;
1516
1521
currentPageCopy . Remove ( PdfName . StructParents ) ;
1522
+ currentPageCopy . Remove ( PdfName . Tabs ) ;
1517
1523
if ( ! ComparePdfObjects ( previousPageCopy , currentPageCopy , usuallyModifiedObjects ) || ! CompareIndirectReferencesObjNums
1518
1524
( previousKid . Get ( PdfName . Parent ) , currentKid . Get ( PdfName . Parent ) , report , "Page parent" ) ) {
1519
1525
report . AddReportItem ( new ReportItem ( DOC_MDP_CHECK , PAGE_MODIFIED , ReportItem . ReportItemStatus . INVALID ) ) ;
1520
1526
return false ;
1521
1527
}
1528
+ if ( ! CompareTabs ( previousKid . GetAsName ( PdfName . Tabs ) , currentKid . GetAsName ( PdfName . Tabs ) ) ) {
1529
+ report . AddReportItem ( new ReportItem ( DOC_MDP_CHECK , TABS_MODIFIED , ReportItem . ReportItemStatus . INVALID ) ) ;
1530
+ return false ;
1531
+ }
1522
1532
PdfArray prevNotModifiableAnnots = GetAnnotsNotAllowedToBeModified ( previousKid ) ;
1523
1533
PdfArray currNotModifiableAnnots = GetAnnotsNotAllowedToBeModified ( currentKid ) ;
1524
1534
if ( ! ComparePageAnnotations ( prevNotModifiableAnnots , currNotModifiableAnnots , report ) ) {
@@ -1533,6 +1543,13 @@ private bool ComparePages(PdfDictionary prevPages, PdfDictionary currPages, Vali
1533
1543
return true ;
1534
1544
}
1535
1545
1546
+ private bool CompareTabs ( PdfName previousTabs , PdfName currentTabs ) {
1547
+ if ( GetAccessPermissions ( ) == AccessPermissions . ANNOTATION_MODIFICATION ) {
1548
+ return true ;
1549
+ }
1550
+ return Object . Equals ( previousTabs , currentTabs ) || ( previousTabs == null && currentTabs . Equals ( PdfName . S ) ) ;
1551
+ }
1552
+
1536
1553
private void CollectRemovedAndAddedAnnotations ( PdfArray previousAnnotations , PdfArray currentAnnotations ) {
1537
1554
ValidationReport dummyReport = new ValidationReport ( ) ;
1538
1555
IList < PdfDictionary > prevAnnots = new List < PdfDictionary > ( ) ;
0 commit comments