Skip to content

Commit ac86541

Browse files
committed
PDFBOX-6145: move content check after page number check so that not all pages get checked
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1931289 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0d815b8 commit ac86541

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,7 @@ protected void processPages(PDPageTree pages) throws IOException
298298

299299
for (PDPage page : pages)
300300
{
301-
if (page.hasContents())
302-
{
303-
processPage(page);
304-
}
301+
processPage(page);
305302
currentPageNo++;
306303
}
307304
}
@@ -343,6 +340,10 @@ public void processPage(PDPage page) throws IOException
343340
&& (startBookmarkPageNumber == -1 || currentPageNo >= startBookmarkPageNumber)
344341
&& (endBookmarkPageNumber == -1 || currentPageNo <= endBookmarkPageNumber))
345342
{
343+
if (!page.hasContents())
344+
{
345+
return;
346+
}
346347
startPage(page);
347348

348349
int numberOfArticleSections = 1;

0 commit comments

Comments
 (0)