Skip to content

Commit 257ae93

Browse files
committed
PDFBOX-6009: test that OBJR and MCR dictionaries have a /Pg entry itself or in the parent
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1925821 13f79535-47bb-0310-9956-ffa450edef68
1 parent c5789f3 commit 257ae93

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import org.apache.pdfbox.text.PDFMarkedContentExtractor;
7070

7171
import static org.junit.jupiter.api.Assertions.assertEquals;
72+
import static org.junit.jupiter.api.Assertions.assertFalse;
7273
import static org.junit.jupiter.api.Assertions.assertNotEquals;
7374
import static org.junit.jupiter.api.Assertions.assertNotNull;
7475
import static org.junit.jupiter.api.Assertions.assertNull;
@@ -984,6 +985,12 @@ else if (kdict.containsKey(COSName.NUMS))
984985
checkElement(pageTree, kdict.getDictionaryObject(COSName.NUMS), kdict);
985986
}
986987

988+
if (COSName.OBJR.equals(kdict.getDictionaryObject(COSName.TYPE)) ||
989+
COSName.MCR.equals(kdict.getDictionaryObject(COSName.TYPE)))
990+
{
991+
assertFalse(kdict.getCOSDictionary(COSName.PG) == null && parentDict.getCOSDictionary(COSName.PG) == null);
992+
}
993+
987994
// if we're an object reference dictionary (/OBJR), check the obj
988995
if (kdict.containsKey(COSName.OBJ))
989996
{
@@ -1481,4 +1488,4 @@ void testPDFBox515() throws IOException
14811488
assertEquals(233, bim.getHeight());
14821489
}
14831490
}
1484-
}
1491+
}

0 commit comments

Comments
 (0)