pdfoutline(1)
π pdfoutline(1) β the fntsample girlies' bookmark maker π
okay bestie, so this is pdfoutline, a lil tool from the fntsample fam that slides outlines (aka bookmarks, the lil clicky sidebar thing π) into your PDFs. she's simple, she's iconic, she has zero options, and honestly? slay.
β¨ NAME β¨
pdfoutline β add outlines (aka bookmarks) to PDF files π
πΈ SYNOPSIS πΈ
pdfoutline input.pdf outlines.txt output.pdf
π¦ DESCRIPTION π¦
so here's the vibe: pdfoutline reads the input file you hand it as the first argument, sprinkles in the outlines from the text file you give as the second argument, and saves the whole glow-up to the file named in the third argument. three files, no drama, no cap π
the outlines file has to be built out of lines that look exactly like this:
<level> <page> Outline text
okay so breaking it down:
<level>and<page>are both integers, bestie. no decimals, no vibes-based numbers.- each field has to be separated by exactly one space β one. single. space. not two, not a tab, not a whole paragraph of space. the way that one space matters is lowkey wild π
- every
<level>value has to be greater than or equal to the<level>of the first line. (so if line one is level0, everything after lives at0or deeper, got it? π«Ά) - page numbering starts with 1. not 0. we're not doing zero-indexed here, periodt.
your outlines file can also have comments β those start with a # in the first column. comments and empty lines just get ignored, they're background characters fr fr. π
and the text is expected to be in UTF-8 encoding. keep it cute, keep it UTF-8. β¨
β¨ OPTIONS β¨
- none.
pdfoutlineaccepts no options. that's it. that's the whole list. she's a minimalist, she's a main character, she does one thing π
π EXAMPLES π
here's an example outlines data file, in all her glory:
0 1 Document title
1 1 Chapter 1
2 1 Chapter 1.1
2 2 Chapter 1.2
1 3 Chapter 2
and using that file gives you outlines like this, look at the lil tree structure go π:
Document title
+-Chapter 1
| +-Chapter 1.1
| +-Chapter 1.2
+-Chapter 2
it's giving organized. it's giving navigable. we're obsessed π«Ά
π BUGS π
okay so listen, there's a known issue and I need you to pay attention because it's messy:
due to a bug in the Perl library PDF::API2 v2.039 and earlier, some Unicode characters get handled incorrectly and cause outline string corruptions. π
the example that lives in the docs rent-free: everything after the CJK character U+4E0A (δΈ) will get corrupted in the PDF output, because its UTF-16 encoding contains the byte 0x0A, which just so happens to be an ASCII newline character. so the poor thing gets read as "newline" and the rest of your string is gone. absolutely tragic π
good news though, bestie: for user convenience, this pdfoutline version ships with a workaround that should let it run flawlessly all the way down to PDF::API2 v2.034. if you're on anything even older than that, please upgrade PDF::API2 β no excuses, it's for your own good π
π AUTHOR π
pdfoutline's author is Ievgenii Meshcheriakov <eugen@debian.org> π
pdfoutline is part of fntsample and can be downloaded from <https://github.com/eugmes/fntsample>.
and that's the whole page, babe β¨ this was fntsample version 5.4, dated 2024-04-01 β go forth and bookmark your PDFs responsibly, mwah ππ
π¦ where this page comes from
- ubuntu noble: fntsample 5.4-3build2
- ubuntu questing: fntsample 5.4-3build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms