claird / PyPDF4

A utility to read and write PDFs with Python
obsolete-https://pythonhosted.org/PyPDF2/
Other
328 stars 61 forks source link

Add Table of Contents feature to `pdfcat` #13

Closed acsor closed 5 years ago

acsor commented 5 years ago

This is the PR that had been left out in PyPDF2. Note that it has been rebased into the latest updates of newnone:master and that those will also be merged.

Description, taken from the previous PR attempt:

The TOC is automatically generated based on the -T flag given to the command line pdfcat util. No custom naming of the entries is currently supported. The value of the TOC entries is based on the title attribute of DocumentInformation; if it is missing, then the original filename is used as a source for that (e.g. Title.pdf becomes Title, and /a/b/Title.pdf just Title).

acsor commented 5 years ago

Some refactorings have introduced some small bugs. I'll reopen this PR once they are estirpated.