UTF8 @B bookmarks on split

This commit is contained in:
John Whitington 2022-04-03 11:31:36 +02:00
parent bf77471e7e
commit 84c74e5ce2
4 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2.6 (next version, to come)
o Allow -utf8 with -split-bookmarks -o @B.pdf to produce UTF8 filenames
2.5.1 (January 2022)
o Fix a regression where standard fonts could not be chosen

View File

@ -4,6 +4,7 @@ open Cpdferror
(* Remove characters which might not make good filenames. *)
let remove_unsafe_characters encoding s =
if encoding = Cpdfmetadata.UTF8 then Pdftext.utf8_of_pdfdocstring s else (* For @B bookmarks splitting. *)
if encoding = Cpdfmetadata.Raw then s else
let chars =
lose

View File

@ -2,8 +2,8 @@
let demo = false
let noncomp = false
let major_version = 2
let minor_version = 5
let version_date = "(patchlevel 1, 31st Jan 2022)"
let minor_version = 6
let version_date = "(devel, 3 April 2022)"
open Pdfutil
open Pdfio

View File

@ -1026,7 +1026,7 @@ cpdf -merge in1.pdf [<range>] in2.pdf [<range>] [<more names/ranges>]
\noindent\verb!cpdf -split in.pdf -o <format> [-chunk <chunksize>]!
\vspace{1.5mm}
\noindent\verb!cpdf -split-bookmarks <level> in.pdf -o <format>!
\noindent\verb!cpdf -split-bookmarks <level> in.pdf [-utf8] -o <format>!
\end{framed}
\vspace{12mm}
@ -1141,6 +1141,8 @@ one of the output files.
\verb! / ? < > \ : * | " ^ + =!
\end{framed}
To prevent this process, and convert bookmark names to UTF8 instead, add \texttt{-utf8} to the command.
\section{Encrypting with Split and Split Bookmarks}
\index{encryption}
The encryption parameters described in Chapter \ref{encryption} may be added to the command line to encrypt each split PDF. Similarly, the \texttt{-recrypt} switch described in Chapter \ref{basicusage} may by given to re-encrypt each file with the existing encryption of the source PDF.