append outlines (bookmarks) from the TOC contents.
to
This is the my case. Google Document exports PDF without outlines. (at least 2024/Nov.)
this program appends outlines from these PDF.
$ sudo apt install libmupdf-dev libmujs-dev
$ sudo apt install libjpeg-dev libgumbo-dev libopenjp2-7-dev
$ sudo apt install libjbig2dec0-dev libfreetype-dev
$ git clone https://github.com/kuri65536/pdf_toc_outlines
$ cd pdf_toc_ooutlines
$ nimble build
$ ./pdf_toc_outlines sample.pdf
option | short | parameter | desc. |
---|---|---|---|
--output | -o | file-name | specify the output file of PDF |
--pages | -p | numbers | search links in specified pages 1 |
--alg | -a | number | specify the match condition of links 2 |
--levels | -l | number | specify the leveling of links 3 |
--merge | -m | number | specify the merge of links 4 |
--subst | -s | number | specify the substitutes of links 5 |
specify the numbers of pages to extract TOC. under construction
usage: --pages [numbers],[numbers],...
numbers: number | range
number: [-0-9]+
range: [number]-[number] or [number]to[number]
example::
1. --pages 1-10 (default)
2. --pages 1-3
3. --pages 1,2,3
4. --pages 1,4-10
5. --pages 1,4,6,8-10
specify the algolithm to determine TOC.
parameter | match condition |
---|---|
1 | match links contains ... strings under construction |
9 | convert all links to outlines in specified pages (default) |
specify the algolithm for leveling the TOC links.
parameter | level condition |
---|---|
1 | x positions of link (default) |
2 | heading numbers under construction |
parameter | merge condition |
---|---|
0 | no merge (default) |
1 | merge the links in same y position under construction |
parameter | merge condition |
---|---|
0 | split by '.' and take the 1st string. (default) |
(1) | regex by the trainling string and take the 1st part of matches under construction |
MIT, see LICENSE
If you have attract or thank to this project, Welcome to help or support with your donations.