mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-04-24 23:08:47 +02:00
Make annotations indirect
This commit is contained in:
parent
64e2eaa9b7
commit
3c8083ecb6
@ -172,14 +172,13 @@ let make_resources fontobjnums =
|
|||||||
Pdf.Dictionary
|
Pdf.Dictionary
|
||||||
[("/Font", Pdf.Dictionary (map (fun fo -> ("/F" ^ string_of_int fo, Pdf.Indirect fo)) (setify fontobjnums)))]
|
[("/Font", Pdf.Dictionary (map (fun fo -> ("/F" ^ string_of_int fo, Pdf.Indirect fo)) (setify fontobjnums)))]
|
||||||
|
|
||||||
let make_annotations annots =
|
let make_annotations pdf annots =
|
||||||
if annots = [] then Pdf.Dictionary [] else
|
if annots = [] then Pdf.Dictionary [] else
|
||||||
Pdf.Dictionary ["/Annots", Pdf.Array annots]
|
Pdf.Dictionary ["/Annots", Pdf.Array (map (function a -> Pdf.Indirect (Pdf.addobj pdf a)) annots)]
|
||||||
|
|
||||||
(* At this stage, just Font and Text and HGlue 0. and VGlue 0. and Newline and
|
(* At this stage, just Font and Text and HGlue 0. and VGlue 0. and Newline and
|
||||||
NewPage elements. Split on NewPages, typeset each page, add font
|
NewPage elements. Split on NewPages, typeset each page, add font
|
||||||
dictionaries. New page only
|
dictionaries. New page only creates a page when that page has content. *)
|
||||||
creates a page when that page has content. *)
|
|
||||||
let typeset lmargin rmargin tmargin bmargin papersize pdf i =
|
let typeset lmargin rmargin tmargin bmargin papersize pdf i =
|
||||||
let debug = false in
|
let debug = false in
|
||||||
if debug then (print_endline "***input:\n\n"; print_endline (to_string i));
|
if debug then (print_endline "***input:\n\n"; print_endline (to_string i));
|
||||||
@ -204,7 +203,7 @@ let typeset lmargin rmargin tmargin bmargin papersize pdf i =
|
|||||||
Pdfpage.mediabox = Pdfpage.rectangle_of_paper papersize;
|
Pdfpage.mediabox = Pdfpage.rectangle_of_paper papersize;
|
||||||
Pdfpage.resources = make_resources !thispagefontnums;
|
Pdfpage.resources = make_resources !thispagefontnums;
|
||||||
Pdfpage.rotate = Pdfpage.Rotate0;
|
Pdfpage.rotate = Pdfpage.Rotate0;
|
||||||
Pdfpage.rest = make_annotations !thispageannotations}
|
Pdfpage.rest = make_annotations pdf !thispageannotations}
|
||||||
in
|
in
|
||||||
pages := page :: !pages
|
pages := page :: !pages
|
||||||
in
|
in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user