Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Add bookmarks into PDF using PyPDF2

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages