diff --git a/ChangeLog b/ChangeLog index 5f464987..e62317b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2019-04-20 Jay Berkenbilt + * Slightly tighten logic that determines whether an object is a + page. The previous logic was sometimes failing to preserve + annotations because they were passing the overly loose test for + whether something was a page. This fix has a slight risk of + causing some extraneous objects to be copied during page splitting + and merging for erroneous PDF files whose page objects contain + invalid types or are missing the /Type key entirely, both of which + would be invalid according to the PDF specification. + * Revert change that included preservation of outlines (bookmarks) in --split-pages. The way it was implemented caused a very significant performance penalty when splitting pages with diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index a3a4d61d..f7c78c57 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -2524,14 +2524,14 @@ QPDFObjectHandle::isPageObject() return true; } // Files have been seen in the wild that have /Type (Page) - if (type.isString() && (type.getStringValue() == "Page")) + else if (type.isString() && (type.getStringValue() == "Page")) { return true; } - } - if (this->hasKey("/Contents")) - { - return true; + else + { + return false; + } } return false; }