Skip to content

RussellLuo/pdfbookmarker

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •