Beginning work on form xobjects squeeze

This commit is contained in:
John Whitington 2014-09-30 18:01:46 +01:00
parent e94b01605b
commit ce4efd0bf3
1 changed files with 6 additions and 1 deletions

View File

@ -66,7 +66,7 @@ let really_squeeze pdf =
(* For a unknown reason, the output file is much smaller if (* For a unknown reason, the output file is much smaller if
Pdf.renumber is run twice. This is bizarre, since Pdf.renumber is Pdf.renumber is run twice. This is bizarre, since Pdf.renumber is
an old, well-understood function in use for years -- what is an old, well-understood function in use for years -- what is
going on? *) going on? Furthermore, if we run it 3 times, it gets bigger again! *)
pdfr := Pdf.renumber changetable !pdfr; pdfr := Pdf.renumber changetable !pdfr;
pdfr := Pdf.renumber changetable !pdfr; pdfr := Pdf.renumber changetable !pdfr;
Pdf.remove_unreferenced !pdfr; Pdf.remove_unreferenced !pdfr;
@ -74,6 +74,11 @@ let really_squeeze pdf =
pdf.Pdf.objects <- !pdfr.Pdf.objects; pdf.Pdf.objects <- !pdfr.Pdf.objects;
pdf.Pdf.trailerdict <- !pdfr.Pdf.trailerdict pdf.Pdf.trailerdict <- !pdfr.Pdf.trailerdict
(* Squeeze the form xobject at objnum. Any resources from the page (or its
ancestors in the page tree!) are also needed - we must merge them with the
ones from the xobject itself. *)
let squeeze_form_xobjects page_resources pdf objnum = ()
(* For each object in the PDF marked with /Type /Page, for each /Contents (* For each object in the PDF marked with /Type /Page, for each /Contents
indirect reference or array of such, decode and recode that content stream. *) indirect reference or array of such, decode and recode that content stream. *)
let squeeze_all_content_streams pdf = let squeeze_all_content_streams pdf =