more
This commit is contained in:
parent
ad5a235c61
commit
10fc61f98a
|
@ -2995,7 +2995,9 @@ let typeset_table_of_contents ~font pdf =
|
||||||
in
|
in
|
||||||
[Cpdftype.BeginDest mark.Pdfmarks.target;
|
[Cpdftype.BeginDest mark.Pdfmarks.target;
|
||||||
Cpdftype.HGlue {Cpdftype.glen = float mark.Pdfmarks.level *. args.fontsize *. 2.; Cpdftype.gstretch = 0.};
|
Cpdftype.HGlue {Cpdftype.glen = float mark.Pdfmarks.level *. args.fontsize *. 2.; Cpdftype.gstretch = 0.};
|
||||||
Cpdftype.Text (explode (of_pdfdocencoding f mark.Pdfmarks.text ^ " " ^ of_pdfdocencoding f label));
|
Cpdftype.Text (explode (of_pdfdocencoding f mark.Pdfmarks.text));
|
||||||
|
Cpdftype.HGlue {Cpdftype.glen = 100.; Cpdftype.gstretch = 0.};
|
||||||
|
Cpdftype.Text (explode (of_pdfdocencoding f label));
|
||||||
(*Cpdftype.Text [' '];
|
(*Cpdftype.Text [' '];
|
||||||
Cpdftype.Text (explode (of_pdfdocencoding f label));*)
|
Cpdftype.Text (explode (of_pdfdocencoding f label));*)
|
||||||
Cpdftype.EndDest;
|
Cpdftype.EndDest;
|
||||||
|
|
10
cpdftype.ml
10
cpdftype.ml
|
@ -57,7 +57,8 @@ let font_widths f fontsize =
|
||||||
256
|
256
|
||||||
(fun x ->
|
(fun x ->
|
||||||
fontsize
|
fontsize
|
||||||
*. float_of_int (Pdfstandard14.textwidth false Pdftext.WinAnsiEncoding stdfont (string_of_char (char_of_int x)))
|
*. float_of_int
|
||||||
|
(Pdfstandard14.textwidth false Pdftext.WinAnsiEncoding stdfont (string_of_char (char_of_int x)))
|
||||||
/. 1000.)
|
/. 1000.)
|
||||||
|
|
||||||
let width_of_string ws s =
|
let width_of_string ws s =
|
||||||
|
@ -174,7 +175,6 @@ let make_annotations annots =
|
||||||
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 =
|
||||||
Printf.printf "l = %f, r = %f, b = %f, t = %f\n" lmargin rmargin tmargin bmargin;
|
|
||||||
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));
|
||||||
let i = layout lmargin rmargin papersize i in
|
let i = layout lmargin rmargin papersize i in
|
||||||
|
@ -214,9 +214,11 @@ let typeset lmargin rmargin tmargin bmargin papersize pdf i =
|
||||||
::!ops;
|
::!ops;
|
||||||
(* If a destination, add the rectangle to the pile of rectangles for this annotation. *)
|
(* If a destination, add the rectangle to the pile of rectangles for this annotation. *)
|
||||||
if s.dest <> None then
|
if s.dest <> None then
|
||||||
thisdestrectangles :=
|
begin
|
||||||
let minx, miny = s.xpos, height -. s.ypos in
|
let minx, miny = s.xpos, height -. s.ypos in
|
||||||
(minx, miny, minx +. width_of_string s.width_table cps, miny +. s.fontsize)::!thisdestrectangles
|
thisdestrectangles := (minx, miny, minx +. width_of_string s.width_table cps, miny +. s.fontsize)::!thisdestrectangles
|
||||||
|
end;
|
||||||
|
s.xpos <- s.xpos +. width_of_string s.width_table cps
|
||||||
| Font (f, fontsize) ->
|
| Font (f, fontsize) ->
|
||||||
let name, objnum =
|
let name, objnum =
|
||||||
match List.assoc_opt f !fonts with
|
match List.assoc_opt f !fonts with
|
||||||
|
|
Loading…
Reference in New Issue