diff --git a/cpdfattach.ml b/cpdfattach.ml index ec7fbb2..80e16ec 100644 --- a/cpdfattach.ml +++ b/cpdfattach.ml @@ -136,7 +136,7 @@ let list_attached_files pdf = | Some ((Pdf.Dictionary _) as d) -> begin match Pdf.lookup_direct pdf "/F" d with | Some stream -> - {name = x; + {name = Pdftext.utf8_of_pdfdocstring x; pagenumber = 0; data = (fun () -> @@ -174,7 +174,7 @@ let list_attached_files pdf = begin match Pdf.lookup_direct pdf "/F" d with | Some stream -> Some - {name = s; + {name = Pdftext.utf8_of_pdfdocstring s; pagenumber = pagenumber; data = (fun () -> @@ -190,7 +190,7 @@ let list_attached_files pdf = end | _ -> Some - {name = s; + {name = Pdftext.utf8_of_pdfdocstring s; pagenumber = pagenumber; data = (fun () -> raise (Pdf.PDFError "no attachment data"))} end diff --git a/cpdfmanual.pdf b/cpdfmanual.pdf index 0ce146c..ca50357 100644 Binary files a/cpdfmanual.pdf and b/cpdfmanual.pdf differ diff --git a/cpdfmanual.tex b/cpdfmanual.tex index aa4874c..0b7d9d8 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -2395,7 +2395,7 @@ NB: For all imposition options, see also discussion of \texttt{-fast} in Section \section{Listing Annotations} \index{annotations!listing} The \texttt{-list-annotations} operation prints the textual content of any -annotations on the selected pages to standard output. Each annotation is preceded by the page number and followed by a newline. See Section \ref{textencodings} for more information on text encodings in the output of this operation. +annotations on the selected pages to standard output. Each annotation is preceded by the page number and followed by a newline. The output of this operation is always UTF8. \begin{framed} \small\verb!cpdf -list-annotations in.pdf > annots.txt! @@ -3285,7 +3285,7 @@ In a PDF file, optional content groups are used to group graphical elements toge \noindent\verb!cpdf -ocg-list in.pdf! \end{framed}} -\noindent List the optional content groups in the PDF, one per line, to standard output. +\noindent List the optional content groups in the PDF, one per line, to standard output. UTF8. {\small\begin{framed} \noindent\verb!cpdf -ocg-rename -ocg-rename-from -ocg-rename-to in.pdf -o out.pdf! diff --git a/cpdfocg.ml b/cpdfocg.ml index dcc6184..dd864c1 100644 --- a/cpdfocg.ml +++ b/cpdfocg.ml @@ -96,7 +96,7 @@ let ocg_get_list pdf = rev !l let ocg_list pdf = - List.iter (Printf.printf "%s\n") (ocg_get_list pdf) + List.iter (Printf.printf "%s\n") (map Pdftext.utf8_of_pdfdocstring (ocg_get_list pdf)) let ocg_rename f t pdf = Pdf.objselfmap