.\" -*- nroff -*- .TH pdfoutline 1 "2022-12-27" "5.4" "fntsample" .SH NAME pdfoutline \- add outlines (aka bookmarks) to PDF files \" macros .de SAMPLE .br .RS .nf .nh .. .de ESAMPLE .hy .fi .RE .. .SH SYNOPSIS .B pdfoutline .I input.pdf outlines.txt output.pdf .SH DESCRIPTION \fBpdfoutline\fP reads input file given as first argument, adds outlines from text file given as second argument, and saves result to file with name given as third argument. .P File with outlines information should consist of lines in the following format: .SAMPLE \fI\fP \fI\fP Outline text .ESAMPLE .P \fI\fP and \fI\fP should be integers. Each field should be separated by exactly one space symbol. All values for \fI\fP should be greater or equal than that of the first line. Page numeration starts with 1. .P Outlines file can contain comments that start with # in first column. Comments and empty lines are ignored. The text is expected to be in UTF-8 encoding. .SH OPTIONS .B pdfoutline accepts no options. .SH EXAMPLES Here is example of outlines data file: .SAMPLE 0 1 Document title 1 1 Chapter 1 2 1 Chapter 1.1 2 2 Chapter 1.2 1 3 Chapter 2 .ESAMPLE .P Using this file will result in outlines like the following: .SAMPLE Document title +-Chapter 1 | +-Chapter 1.1 | +-Chapter 1.2 +-Chapter 2 .ESAMPLE .SH BUGS Due to a bug in Perl library \fBPDF::API2 v2.039\fP and earlier, some Unicode characters are handled incorrectly and cause outline string corruptions. For example, everything after the CJK character U+4E0A (上) will get corrupted in the PDF output because its UTF-16 encoding contains byte 0x0A, which happens to be an ASCII newline character. .P For user convenience, this \fBpdfoutline\fP version includes a workaround that should allow flawless operation down to \fBPDF::API2 v2.034\fP. Users of even earlier versions should upgrade \fBPDF::API2\fP. .P .SH AUTHOR .B pdfoutline author is Ievgenii Meshcheriakov .br \fBpdfoutline\fP is part of \fBfntsample\fP and can be downoaded from .