Skip to content

A command line tool for adding an outline to pdf files

License

Notifications You must be signed in to change notification settings

eggplants/pdfoutline

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pdfoutline

PyPI ghcr image

Release Package pre-commit.ci status

A command line tool for adding an outline (a bookmark, or table of contents) to pdf files.

Prerequisites

Make sure you have ghostscript installed.

# Mac
brew install ghostscript

# Debian, Ubuntu
sudo apt install ghostscript

ghostscript for windows can be installed from the official website

Usage

$ pip install pdfoutline
...

$ pdfoutline sample.pdf sample.toc sample-out.pdf
 |██████████████████████----------------------------| 118/263

optionally, the ghost script executable can be specified as well

pdfoutline sample.pdf sample.toc sample-out.pdf --gs_path 'C:\Program Files\gs\gs9.55.0\bin\gswin64.exe'

Demo

demo

Sample output:

sample

Sample Table of contents file: sample.toc

# this is a comment
First Chapter 1
    first section 1
        first subsection 1
    second section 4
    third section 5

# a command to fix a gap between pdf pages and content pages
+10

Second Chapter 10
    some entry 10
    some entry 11

About

A command line tool for adding an outline to pdf files

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Python 97.9%
  • Dockerfile 2.1%