All Projects → RussellLuo → pdfbookmarker

RussellLuo / pdfbookmarker

Licence: other
Add bookmarks into PDF using PyPDF2

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

PDFBookmarker

Add bookmarks into PDF using PyPDF2.

Installation

Install pdfbookmarker:

$ pip install pdfbookmarker

Usage

  1. Turn to your target PDF (e.g. MyBook.pdf), record bookmark titles and page numbers of the PDF into a TEXT file (e.g. my_bookmarks.txt) by hand with the following format:

    <nested level>"<bookmark title>"|<page number>
    

    For samples, see sample_bookmarks.txt. (Offsets are also supported, see here)

  2. Generate a copy of MyBook.pdf with additional bookmarks file specified by my_bookmarks.txt:

    $ pdfbm MyBook.pdf my_bookmarks.txt

    An auto-detected, expected or suggested filename for bookmarks is MyBook.txt, when the input filenamne e.g. is MyBook.pdf.

    The default filename of the output PDF is MyBook-new.pdf; You, of course, can specify the filename explicitly:

    $ pdfbm MyBook.pdf my_bookmarks.txt MyBook_with_bookmarks.pdf

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].