rbrito / scripts

Random scripts of mine
3 stars 3 forks source link

Update optimize_pdfs.py #3

Open byronwall opened 2 years ago

byronwall commented 2 years ago

Had to use .Root instead of .root when using the latest version of pikepdf. The deprecation of .root was mentioned in their release notes at: https://pikepdf.readthedocs.io/en/latest/release_notes.html#id1

Deprecated or private functions were removed: - Object.pagecontents (use Page.contents_) - Object.images (use Page.images) - Page._attach (use the new attachment API) - Stream(obj=) (deprecated obj parameter removed) - Pdf.root (use Pdf.Root) - Pdf._process (use Pdf.open(BytesIO(...)) instead)

Other than this issue, I really appreciate you putting this script together. It's been a real gem in terms of cleaning up files.