Author: tilman
Date: Mon May 26 12:53:22 2025
New Revision: 1925819

URL: http://svn.apache.org/viewvc?rev=1925819&view=rev
Log:
PDFBOX-6009: test that OBJR and MCR dictionaries have a /Pg entry itself or in 
the parent

Modified:
    
pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java

Modified: 
pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java
URL: 
http://svn.apache.org/viewvc/pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java?rev=1925819&r1=1925818&r2=1925819&view=diff
==============================================================================
--- 
pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java
 (original)
+++ 
pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java
 Mon May 26 12:53:22 2025
@@ -69,6 +69,7 @@ import org.apache.pdfbox.rendering.PDFRe
 import org.apache.pdfbox.text.PDFMarkedContentExtractor;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
@@ -985,6 +986,12 @@ class PDFMergerUtilityTest
                 checkElement(pageTree, 
kdict.getDictionaryObject(COSName.NUMS), kdict);
             }
 
+            if (COSName.OBJR.equals(kdict.getDictionaryObject(COSName.TYPE)) ||
+                COSName.MCR.equals(kdict.getDictionaryObject(COSName.TYPE)))
+            {
+                assertFalse(kdict.getCOSDictionary(COSName.PG) == null && 
parentDict.getCOSDictionary(COSName.PG) == null);
+            }
+
             // if we're an object reference dictionary (/OBJR), check the obj
             if (kdict.containsKey(COSName.OBJ))
             {
@@ -1482,4 +1489,4 @@ class PDFMergerUtilityTest
             assertEquals(233, bim.getHeight());
         }
     }
-}
\ No newline at end of file
+}


Reply via email to