This commit is contained in:
John Whitington 2021-11-21 17:27:51 -08:00
parent 6f0b8e2f66
commit 2768495bf1
1 changed files with 9 additions and 1 deletions

View File

@ -126,7 +126,11 @@ let layout lmargin rmargin papersize i =
s.xpos <- s.xpos +. glen; s.xpos <- s.xpos +. glen;
o := glue :: !o; o := glue :: !o;
if s.xpos >= xpos_max then layout_element NewLine if s.xpos >= xpos_max then layout_element NewLine
| x -> o := x :: !o | NewLine ->
s.xpos <- lmargin;
o := NewLine :: !o
| x ->
o := x :: !o
in in
iter layout_element i; iter layout_element i;
rev !o rev !o
@ -144,7 +148,11 @@ let make_resources fontobjnums =
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 i = layout lmargin rmargin papersize i in let i = layout lmargin rmargin papersize i in
print_endline "***after layout:\n\n";
print_endline (to_string i);
let i = paginate tmargin bmargin papersize i in let i = paginate tmargin bmargin papersize i in
print_endline "***after pagination:\n\n";
print_endline (to_string i);
let height = Pdfunits.convert 72. (Pdfpaper.unit papersize) Pdfunits.PdfPoint (Pdfpaper.height papersize) in let height = Pdfunits.convert 72. (Pdfpaper.unit papersize) Pdfunits.PdfPoint (Pdfpaper.height papersize) in
let s = initial_state () in let s = initial_state () in
s.xpos <- lmargin; s.xpos <- lmargin;