🛠 Fix: fixed page stamping when the page's content was a referenced object instead or a direct array of content references. Credit to vitstradal for discovering the issue.
🛠 Fix hopefully fixed issue #33 (NoMethodError undefined method
🛠 Fix/Feature: (related to issue #32)
Experience shows that it's very difficult to know when to use
page.copy(true)before stamping one pdf pages on top (or under) another... So...
Now there is no longer any need for the guesswork. The process is automated for you.
The moment CombinePDF recognizes a resource name conflice between two pages (such as both pages using one font name to reference two different fonts), CombinePDF will intrusively rename the incoming page's resources.
It is true that the intrusive resource renaming is somewhat risky and might require the inflation of some comperssed page data (resulting in bigger file sizes), but this is the only way to attempt and prevent PDF data curruption.
🛠 Fix: Fixed an issue where a malformed PDF String could cause the parser to hang.
⚡️ Update: Inner PDF links (links to pages within the PDF file) will now be preserved when importing a whole PDF (although Outlines, for now, are discarede and their related links will be discarded as well). If the same destination page is inserted more than once (the first version will be preferred).
🗄 Deprecation Warning: the
Page_Methods#make_securemethods are deprecated. Use
Page_Methods#copy(true)for safeguarding against font/resource conflicts when "stamping" one PDF page over another.
🛠 fixed: Hasan Iskandar fixed issue #30 - Output file cannot be saved from Adobe Reader with "Save As optimizes for Fast Web View" preference enabled. Thank you Hasan.
⚡️ update: More parsing error detection; Updated the endstream EOL marker indentifier for safer indentification.
🔋 feature: circumvents an issue with 'wkhtmltopdf', where sometimes the
endobjkeyword would be missing, causing malformed PDF data. The parser will now attempt to auto-fix any
semi-fix: make sure decryption is attempetd using actual values (vs. references). The code was updated for a similar result as should have been achived before.
🛠 fixed: Fixed the default page sizes which weren't as described in the documentation and now default to US Letter. The documentation was also fixed. No major version bump is declered since the defaults were faulty and weren't as described (fixed a bug, not changed the API).
🔋 feature: added the
resizepage method, to allow resizing of pages with or without conserving the content's aspect ratio (defaults to conserving the aspect ratio).
⚡️ update: a better general error message for CombinePDF.new
🛠 fix: the
make_securenow correctly sets the secure copy flag, as expected. For performance reasons it is better to use page.copy(true) for renaming conflicting resource identifiers, but if multiple secure copies are needed for some reason, using
make_securewill now make sure each copy is secured independently.
🛠 fix: the secure copy now worked as expected (it had issue with referenced resource dictionaries that was resolved by following the references).
🛠 fix: fixed an object numbering issue introduced by duplicating pages as part of the Adobe Reader bug workaround. The issue was thought to have been fixed before but some PDF structures were not proprly addressed.
🛠 fix: fixed the default value for the :location attribute of PDF#stamp_pages(String, options). Now, instead of the default stamp being written at [:top, :bottom], it's default location will be set to [:center].
🛠 fix: fixed the 'center' location in the page numbering, so that it wouldn't enforce a small font on an all page centered number.
🛠 fix: better page stamping... or, at least more secure (we hope).
🔋 feature: added the PDF#stamp_pages shortcut method. Credit to Tania (@taniarv) for the concept.
🛠 fix: possible string encoding issues could have arose when strings were rendered to PDF format. Credit to Tania (@taniarv) for exposing the issue.
🔋 feature: Metadata is now easier to set by allowing fast access to the Information header when using PDF#save and PDF#to_pdf. Credit to Tania (@taniarv) for code.