Skip to content

Instantly share code, notes, and snippets.

@lesterlo
Last active June 13, 2020 18:58
Show Gist options
  • Save lesterlo/4b0357683f4ad3a0e23b0e037ded4776 to your computer and use it in GitHub Desktop.
Save lesterlo/4b0357683f4ad3a0e23b0e037ded4776 to your computer and use it in GitHub Desktop.
Add table of content to existing PDF file

Command

k2pdfopt -mode copy -n -toclist toc.txt srcfile.pdf -o outfile.pdf

# Copy mode, Native PDF output

file Format

toc.txt

The First column is page number, others are chapter's name

1 Page 1
10 Charpter 2

Reference

https://github.com/aminya/tocPDF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment