From c192d3fa0f5cf97f3fe03035bbbe758ae92b2169 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 27 Oct 2021 15:29:25 +0100 Subject: [PATCH] +utf8 --- cpdf.ml | 4 ++-- cpdfmanual.tex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpdf.ml b/cpdf.ml index f9aef8f..aecadb8 100644 --- a/cpdf.ml +++ b/cpdf.ml @@ -640,7 +640,7 @@ let mark_of_json pdf = function ("open", `Bool openstatus); ("target", target)] -> {Pdfmarks.level = level; - Pdfmarks.text = text; + Pdfmarks.text = Pdftext.pdfdocstring_of_utf8 text; Pdfmarks.target = target_of_json_target pdf pagenumber target; Pdfmarks.isopen = openstatus} | _ -> error "malformed mark in mark_of_json" @@ -886,7 +886,7 @@ let output_json_marks ch calculate_page_number pdf fastrefnums marks = let json_of_mark m = `Assoc [("level", `Int m.Pdfmarks.level); - ("text", `String m.Pdfmarks.text); + ("text", `String (Pdftext.utf8_of_pdfdocstring m.Pdfmarks.text)); ("page", `Int (calculate_page_number m)); ("open", `Bool m.Pdfmarks.isopen); ("target", json_of_target pdf fastrefnums m.Pdfmarks.target)] diff --git a/cpdfmanual.tex b/cpdfmanual.tex index b8a8c0b..73d873e 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -2,7 +2,7 @@ %Document -decrypt-force %Document -collate %Document -impose and friends (inc. 0-w, 0-h for long ones, how lines scale etc., undefined if pages different sizes) -%Document -bookmarks-json including special "none" target +%Document -bookmarks-json including mentioning UTF8 \documentclass{book} % Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf etc.