From 09d0e912ca7dea1fedb1f129ebffb9b6df36b07a Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 21 Jun 2023 15:38:32 +0100 Subject: [PATCH] Deprecate -squeeze-no-recompress --- cpdfcommand.ml | 6 +++--- cpdfmanual.pdf | Bin 393037 -> 392993 bytes cpdfmanual.tex | 2 +- cpdfsqueeze.ml | 10 +++------- cpdfsqueeze.mli | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) 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 181907662705700db3a5376e3b3c195329d9b8f6..492ba8ca896cbf7457f506e529ef3df8c5e11f6e 100644 GIT binary patch delta 5003 zcmai1XH=70uqA=ei+}{A1f(e)=_T|oRT1eBFA#cDfdr5bk!GQz6s3cqNJl{kB_K_@ z^cF%9ks>9CbRO6H{=8rB$E-DLX74#Ov(7$ioq==KymQv@I*=IyNIJzoMhGakG)|b4 zqix=<+{uH$)pbYew{mX|8#k&)z-ExX?(`0}(#sQ{1f7OV>RVe<4MMi2d;j6s=eOn+ zdJ!62Sm|5ou)qd$5v~2ETmM$y5b5m9;_CjsU{>n*s$tV{=*i;mxWrx~Gyh(uJl=Rs z-=L$GpqOzRb{NMe8;-u^`W9fC`#x`+{iH>UjrDamJS0; zoO{RSFHkp@uHY3hB&esp?x%bm`bUC_$q930^y32`g?vg}{xaQm(0RlB$gLLtC*uv` zbF>wbQS=DJ2jm+Xtlmb*SDeCxEE{v>&c@VddEA%rp?XWlios2`!Mc$X}y0H zj?L`3*_I~wnDvB-*A3*cajUb#a=fOSD}hfNWfdB1tZwvAr@X=u|2+iAp$CW^`<)^$ z%9eAD1(e9iR6>=g_S!{#mc*HI$S5H-nKpI*uKQWQ=}Xi?WOfbP2eK6Uyjz}iSu=U~a9w@CQa_f*2~qlf(Yu+cvc^LeH^)NzGx ziS@6lIS;|qV5(rLSyJA;2lZe4G=-C0^u50(r*ak!Ya9)0dGRm@`?G~ccO?Imv?`tn zaa>S7UbiER9N&4v$??ausdQ?w?!cacYIB|9bnpZ(djeCt0xSr2-KMbnCBBHWdUIPk zhLHym!Prl_5JN)+YrPR&PAO%-Wm;y`rTsAr!{~+;_gAeZX1zU3|72o82$|7c*Bj1y z`drUb$V%`of7f;*acaZYxd&kyuHrO|Kl!v?cI6jOeThd+go{trWVXtUnQ%tt- zXvRm+`tq4Tec(3&!WHt&5p1*;32!_ZWjWK~F!#l=X)Okwk1c(`&`{->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%J?y*YQZ zONaa07y^lqi%mY1Ybv**0MsGojzP4g8(Q>RuA_0wAoOi)P}c%?bg+3*xQsFl8OsFu z*=7XE#2R<;$f0JVwk}}k;<#?Uoh`*t&Ek1W3T3bH57C9dhUoW_=2uTy*Ig&$lCm=n z?t_K`Txwwum#?M<-1+;>VGW*!`rxpJ07G2y@W_4G^p}$7aj*}~hFT6qur^A*2*K!c z)dA&>;4j-h-`MICzZVZ}bhIfF4npqZ?xoL-r@0@HcoaqP9vD>Eg-&0u9py%Geg6n= zj6Of#?_Te>^J?2u28&u6x^xX}RVg!4L~ggDV4a$jo9jC(_=HNV8Bu#&x@Ly6;d`Z- z%lb+PBxjuM#&3^nx`sdS412$~rl@1p)%UIsr-7r9JauZvLv|=T5dEJx3)f5X8!+eD zmU0W=L0<{+$UGo6$;A>|d&HVajPh7WR@0e|_qbmz{a14SoX(%y^i5ViVGXD?a C5Sdy4 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