Oh... pdfcrop works great, but also removes the metadata table of contents from PDFs.
Any other tool for cropping PDFs that keeps TOCs? Or maybe one that can export/import TOCs?
Oh... pdfcrop works great, but also removes the metadata table of contents from PDFs.
Any other tool for cropping PDFs that keeps TOCs? Or maybe one that can export/import TOCs?
Maybe I'll simply use Calibre to convert PDF->ePub->PDF and set the margins to zero.
Calibre was a bit of a mess, so I finally used pdfcrop and pdftk, another great tool.
Dump the metadata:
pdftk orig.pdf dump_data output orig.info
Then pdfcrop the original pdf:
pdfcrop --margin '0 0 0 0' orig.pdf crop.pdf
Then get the cropped metadata to maintain the box size:
pdftk crop.pdf dump_data output crop.info
Then manually edit the metadata (copy-paste the original bookmarks section).
Then finally apply that new metadata:
pdftk crop.pdf update_info crop.info output final.pdf
I should post this kind of notes on a blog for my future self, I guess...
Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.
All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.