diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 0774a9f..b68edf9 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -3288,7 +3288,7 @@ let write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf = if not is_decompress then begin ignore (Cpdfsqueeze.recompress_pdf pdf); - if args.squeeze then Cpdfsqueeze.squeeze ~pagedata:args.squeeze_pagedata ~recompress:args.squeeze_recompress ?logto:!logto pdf; + if args.squeeze then Cpdfsqueeze.squeeze ~pagedata:args.squeeze_pagedata ?logto:!logto pdf; end; Pdf.remove_unreferenced pdf; really_write_pdf ~is_decompress mk_id pdf outname @@ -3303,7 +3303,7 @@ let write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf = if not is_decompress then begin ignore (Cpdfsqueeze.recompress_pdf pdf); - if args.squeeze then Cpdfsqueeze.squeeze ~pagedata:args.squeeze_pagedata ~recompress:args.squeeze_recompress ?logto:!logto pdf; + if args.squeeze then Cpdfsqueeze.squeeze ~pagedata:args.squeeze_pagedata ?logto:!logto pdf; Pdf.remove_unreferenced pdf end; really_write_pdf ~encryption ~is_decompress mk_id pdf temp; @@ -3342,7 +3342,7 @@ let fast_write_split_pdfs (stem original_filename) startpage endpage in Pdf.remove_unreferenced pdf; - if sq then Cpdfsqueeze.squeeze ~pagedata:args.squeeze_pagedata ~recompress:args.squeeze_recompress ?logto:!logto pdf; + if sq then Cpdfsqueeze.squeeze ~pagedata:args.squeeze_pagedata ?logto:!logto pdf; really_write_pdf ~encryption:enc (not (enc = None)) pdf name) (indx pagenums) pagenums diff --git a/cpdfmanual.pdf b/cpdfmanual.pdf index 1819076..492ba8c 100644 Binary files a/cpdfmanual.pdf and b/cpdfmanual.pdf differ diff --git a/cpdfmanual.tex b/cpdfmanual.tex index e65ef62..4e49353 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -1869,7 +1869,7 @@ Final file size is 187200 bytes, 78.60% of original. \noindent The \texttt{-squeeze-log-to } option writes the log to the given file instead of to standard output. Log content is appended to the end of the log file, preserving existing contents. -There are two options which turn off parts of the squeezer. They are \texttt{-squeeze-no-recompress} for avoiding the reprocessing of compressed sections (especially useful if they are malformed), and \texttt{-squeeze-no-pagedata} for avoiding the reprocessing of page data (ditto). These two options also make the process much faster at the cost of a little less compression. Experiment. +The option \texttt{-squeeze-no-pagedata} avoids the reprocessing of page data, which avoids problems in case of malformed files, and makes the process much faster at the cost of a little less compression. The option \texttt{-squeeze-no-recompress} is deprecated as of version 2.6 and has no effect. \begin{cpdflib} \clearpage diff --git a/cpdfsqueeze.ml b/cpdfsqueeze.ml index fb26f24..06ab481 100644 --- a/cpdfsqueeze.ml +++ b/cpdfsqueeze.ml @@ -210,7 +210,7 @@ let squeeze_all_content_streams pdf = pdf (* We run squeeze enough times for the number of objects to not change *) -let squeeze ?logto ?(pagedata=true) ?(recompress=true) pdf = +let squeeze ?logto ?(pagedata=true) pdf = let log x = match logto with None -> print_string x; flush stdout @@ -233,11 +233,8 @@ let squeeze ?logto ?(pagedata=true) ?(recompress=true) pdf = log (Printf.sprintf "Squeezing page data and xobjects\n"); squeeze_all_content_streams pdf; end; - if recompress then - begin - log (Printf.sprintf "Recompressing document\n"); - ignore (recompress_pdf pdf); - end + log (Printf.sprintf "Recompressing document\n"); + ignore (recompress_pdf pdf); with e -> raise @@ -245,4 +242,3 @@ let squeeze ?logto ?(pagedata=true) ?(recompress=true) pdf = (Printf.sprintf "Squeeze failed. No output written.\n Proximate error was:\n %s" (Printexc.to_string e))) - diff --git a/cpdfsqueeze.mli b/cpdfsqueeze.mli index e532f6f..2c16af3 100644 --- a/cpdfsqueeze.mli +++ b/cpdfsqueeze.mli @@ -8,4 +8,4 @@ val recompress_pdf : Pdf.t -> Pdf.t val decompress_pdf : Pdf.t -> Pdf.t (** Squeeze a PDF *) -val squeeze : ?logto:string -> ?pagedata:bool -> ?recompress:bool -> Pdf.t -> unit +val squeeze : ?logto:string -> ?pagedata:bool -> Pdf.t -> unit