Skip to content

Commit

Permalink
Fixing boolean logic to allow PDFs with an incorrect pages dict to be…
Browse files Browse the repository at this point in the history
… read in debugmode
  • Loading branch information
michaeldemey authored and amedee committed Dec 31, 2015
1 parent 13d42c2 commit a1821cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions itext/src/main/java/com/itextpdf/text/pdf/PdfReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1252,8 +1252,10 @@ protected void readPages() throws IOException {
}
rootPages = catalog.getAsDict(PdfName.PAGES);
if (rootPages == null || !PdfName.PAGES.equals(rootPages.get(PdfName.TYPE))) {
if (debugmode && LOGGER.isLogging(Level.ERROR)) {
LOGGER.error(MessageLocalization.getComposedMessage("the.document.has.no.page.root"));
if (debugmode) {
if ( LOGGER.isLogging(Level.ERROR) ) {
LOGGER.error(MessageLocalization.getComposedMessage("the.document.has.no.page.root"));
}
}
else {
throw new InvalidPdfException(MessageLocalization.getComposedMessage("the.document.has.no.page.root"));
Expand Down

0 comments on commit a1821cc

Please sign in to comment.