py-pdf / pdfly

CLI tool to extract (meta)data from PDF and manipulate PDF files
BSD 3-Clause "New" or "Revised" License
109 stars 18 forks source link

ENH: Added a command offset-update to adjust offsets and lengths. #13

Closed srogmann closed 2 years ago

srogmann commented 2 years ago

This command adjusts /Length-entries of stream objects and the xref-offsets in simple PDF files (ASCII only, one xref section only).

You may check it using https://raw.githubusercontent.com/py-pdf/PyPDF2/main/resources/issue-297.pdf and qpdf or ghostscript.

MartinThoma commented 2 years ago

Thank you for the PR @srogmann !

I've just renamed cpdf to pdfly (see #12 for the reason). This means that your PR has merge conflicts which are easiest to solve by opening another PR. I'm sorry for that. If you want, I can take care of it and use the "co-authored by" feature of Github to give you attribution.

Besides that, I've noticed two things I would change: