next up previous contents index
Next: Pages Up: Merging and Splitting Previous: Splitting   Contents   Index


Splitting on Bookmarks

The -split-bookmarks <level> operation splits a PDF file into a number of parts, according to the page ranges implied by the document's bookmarks. These parts are then written to file with names generated from the given format.
\begin{framed}\small
\verb!cpdf -split-bookmarks 0 a.pdf -o out%%%.pdf!
\par
\v...
...exttt{out001.pdf},
\texttt{out002.pdf} on bookmark boundaries.
\par
\end{framed}
Now, there may be many bookmarks on a single page (for instance, if paragraphs are bookmarked or there are two subsections on one page). The splits calculated by -split-bookmarks ensure that each page appears in only one of the output files. It is possible to use the @ operators above, and an additional operator @B which expands to the text of the bookmark:


\begin{framed}\small
\verb!cpdf -split-bookmarks 0 a.pdf -o @B.pdf!
\par
\vspac...
... bookmark boundaries, using the bookmark text as the filename.
\par
\end{framed}
The bookmark text is converted from unicode to ASCII, and the following characters are removed, in addition to any character with ASCII code less than 32 or more than 126:
\begin{framed}
\centering
\verb! / ? < > \ : * \vert '' ^ + =!
\end{framed}



root 2008-12-01