Skip to main content

Adds bookmarks to PDF documents.

Project description

pdfoutline

A command line tool that adds a bookmark (table of contents, or outline) to PDF files.

Prerequisites

Make sure you have ghostscript installed. In Mac, you can use homebrew:

brew install ghostscript

ghostscript for windows can be installed from the official website

Then install (TODO)

$ git clone git@github.com:yutayamamoto/pdfoutline.git
$ cd pdfoutline
$ pip install .

Sample output

Sample bookmark file: sample.bkm

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

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

Second Chapter 10
    some entry 10
    some entry 11

Usage

$ pdf-yaml-bookmark sample.pdf sample.bkm -o sample-out.pdf --show-progress
 |██████████████████████----------------------------| 118/263

optionally, the ghost script executable can be specified as well

$ pdf-yaml-bookmark sample.pdf sample.bkm -o sample-out.pdf --gs-path 'C:\Program Files\gs\gs9.55.0\bin\gswin64.exe' --show-progress

It also supports for bookmark in YAML format:

$ pdf-yaml-bookmark sample.pdf sample.yaml --format='yaml' -o sample-out.pdf

where a YAML file looks like:

# This is a comment
-
 heading: First Chapter
 page: 1
 children:
    -
     heading: First section
     page: 1
     children:
        -
         heading: Second section
         page: 1
         children:
-
 heading: First Chapter
 page: 1
 children:
    -
     heading: First section
     page: 1
     children:
    -
     heading: Second section
     page: 1
     children:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf_yaml_bookmark-0.0.1.tar.gz (90.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_yaml_bookmark-0.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file pdf_yaml_bookmark-0.0.1.tar.gz.

File metadata

  • Download URL: pdf_yaml_bookmark-0.0.1.tar.gz
  • Upload date:
  • Size: 90.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for pdf_yaml_bookmark-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2f572a5e7f6317396277c5dd8e1114077b9061cb323c4ef6d626eee43c9c0cae
MD5 28a0c2ec0686cd983f0b4bc692550d8b
BLAKE2b-256 dd1d24e5ea120d7e3db5e0feb8fd21770cd505efa5c9771d306f5a7a6954ed46

See more details on using hashes here.

File details

Details for the file pdf_yaml_bookmark-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pdf_yaml_bookmark-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be173f3de8f0f5d10f6485b623bd611a602bef0a553607567ad9a3ed4e406d82
MD5 6d9dab82052968fb526eb8f9e2f54237
BLAKE2b-256 da7235bb047cea7b580c529f377be023fe6401095dbb95806df598b433438b05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page