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

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

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

Modified: 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java
URL: 
http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java?rev=1925820&r1=1925819&r2=1925820&view=diff
==============================================================================
--- 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java
 (original)
+++ 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java
 Mon May 26 12:53:26 2025
@@ -32,6 +32,7 @@ import java.util.TreeSet;
 
 import junit.framework.TestCase;
 import static junit.framework.TestCase.assertEquals;
+import static junit.framework.TestCase.assertFalse;
 import static junit.framework.TestCase.fail;
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
@@ -956,6 +957,12 @@ public class PDFMergerUtilityTest extend
                 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))
             {


Reply via email to