Commit caab1b0e1642bc6ee0194c7ab4c4a4de2ab22f2c
1 parent
4071db59
Handle pages with no /Contents from getPageContents()
The spec allows /Contents to be omitted for pages that are blank, but QPDFObjectHandle::getPageContents() was throwing an exception in this case.
Showing
5 changed files
with
23 additions
and
2 deletions
ChangeLog
| 1 | +2014-11-14 Jay Berkenbilt <ejb@ql.org> | |
| 2 | + | |
| 3 | + * Bug fix: QPDFObjectHandle::getPageContents() no longer throws an | |
| 4 | + exception when called on a page that has no /Contents key in its | |
| 5 | + dictionary. This is allowed by the spec, and some software | |
| 6 | + packages generate files like this for pages that are blank in the | |
| 7 | + original. | |
| 8 | + | |
| 1 | 9 | 2014-06-07 Jay Berkenbilt <ejb@ql.org> |
| 2 | 10 | |
| 3 | 11 | * 5.1.2: release | ... | ... |
libqpdf/QPDFObjectHandle.cc
qpdf/qtest/qpdf.test
| ... | ... | @@ -199,7 +199,7 @@ $td->runtest("remove page we don't have", |
| 199 | 199 | show_ntests(); |
| 200 | 200 | # ---------- |
| 201 | 201 | $td->notify("--- Miscellaneous Tests ---"); |
| 202 | -$n_tests += 72; | |
| 202 | +$n_tests += 73; | |
| 203 | 203 | |
| 204 | 204 | $td->runtest("qpdf version", |
| 205 | 205 | {$td->COMMAND => "qpdf --version"}, |
| ... | ... | @@ -554,6 +554,11 @@ $td->runtest("check file", |
| 554 | 554 | {$td->FILE => "a.pdf"}, |
| 555 | 555 | {$td->FILE => "indirect-decode-parms-out.pdf"}); |
| 556 | 556 | |
| 557 | +$td->runtest("handle page no with contents", | |
| 558 | + {$td->COMMAND => "qpdf --show-pages page-no-content.pdf"}, | |
| 559 | + {$td->FILE => "page-no-content.out", $td->EXIT_STATUS => 0}, | |
| 560 | + $td->NORMALIZE_NEWLINES); | |
| 561 | + | |
| 557 | 562 | show_ntests(); |
| 558 | 563 | # ---------- |
| 559 | 564 | $td->notify("--- Numeric range parsing tests ---"); | ... | ... |
qpdf/qtest/qpdf/page-no-content.out
0 → 100644
qpdf/qtest/qpdf/page-no-content.pdf
0 → 100644
No preview for this file type