From 3df7a6817e4496714b3c78a8ab2a19ad11fb8b55 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Mon, 8 Jul 2019 15:13:34 +0100 Subject: [PATCH] Working on plumbin -fast through two up and stamp (hence nobble) --- cpdf.ml | 8 ++++---- cpdf.mli | 9 +++++---- cpdfcommand.ml | 4 ++-- cpdfmanual.tex | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cpdf.ml b/cpdf.ml index a3bb28d..e0aa5ae 100644 --- a/cpdf.ml +++ b/cpdf.ml @@ -3111,7 +3111,7 @@ let twoup_transforms mediabox = (* Combine two pages into one throughout the document. The pages have already had their objects renumbered so as not to clash.*) -let twoup_pages pdf = function +let twoup_pages fast pdf = function | [] -> assert false | (h::_) as pages -> let resources' = @@ -3163,7 +3163,7 @@ let twoup_stack_transforms mediabox = [t0; t1] (* FIXME: Add clipping, as for twoup, or merge these two functions properly *) -let twoup_pages_stack pdf = function +let twoup_pages_stack fast pdf = function | [] -> assert false | (h::_) as pages -> let resources = @@ -3219,9 +3219,9 @@ let f_twoup f_pages pdf = (*print_changes changes;*) Pdfpage.change_pages ~changes true pdf pages' -let twoup pdf = f_twoup twoup_pages pdf +let twoup fast pdf = f_twoup (twoup_pages fast) pdf -let twoup_stack pdf = f_twoup twoup_pages_stack pdf +let twoup_stack fast pdf = f_twoup (twoup_pages_stack fast) pdf (* \section{Output info} *) let get_info raw pdf = diff --git a/cpdf.mli b/cpdf.mli index a51747f..6c36791 100644 --- a/cpdf.mli +++ b/cpdf.mli @@ -384,12 +384,13 @@ val remove_annotations : int list -> Pdf.t -> Pdf.t (** {2 Imposition} *) (** The twoup_stack operation puts two logical pages on each physical page, -rotating them 90 degrees to do so. The new mediabox is thus larger. *) -val twoup_stack : Pdf.t -> Pdf.t +rotating them 90 degrees to do so. The new mediabox is thus larger. Bool true +(fast) if assume well-formed ISO content streams. *) +val twoup_stack : bool -> Pdf.t -> Pdf.t (** The twoup operation does the same, but scales the new sides down so that -the media box is unchanged. *) -val twoup : Pdf.t -> Pdf.t +the media box is unchanged. Bool true (fast) if assume well-formed ISO content streams. *) +val twoup : bool -> Pdf.t -> Pdf.t (** {2 Making new documents} *) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 884bcc3..cee724d 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -4261,9 +4261,9 @@ let go () = | Some RemoveBookmarks -> write_pdf false (Pdfmarks.remove_bookmarks (get_single_pdf args.op false)) | Some TwoUp -> - write_pdf false (Cpdf.twoup (get_single_pdf args.op false)) + write_pdf false (Cpdf.twoup args.fast (get_single_pdf args.op false)) | Some TwoUpStack -> - write_pdf false (Cpdf.twoup_stack (get_single_pdf args.op false)) + write_pdf false (Cpdf.twoup_stack args.fast (get_single_pdf args.op false)) | Some (StampOn over) -> let overpdf = match over with diff --git a/cpdfmanual.tex b/cpdfmanual.tex index 4ab1564..21edecc 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -24,6 +24,7 @@ %FIXME: Document -bookmarks-open-to-level %FIXME: Explain in key places that you probably want UTF8 a lot %FIXME: Document new -create-pdf functionality +%FIXME: Explain fast more / better and list things it works on \documentclass{book} \usepackage{palatino}