diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 382418e..9d42eec 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -1929,7 +1929,7 @@ let get_single_pdf_nodecrypt read_lazy = | _ -> raise (Arg.Bad "cpdf: No input specified.\n") -let really_write_pdf ?(encryption = None) mk_id pdf outname = +let really_write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf outname = if args.debugcrypt then Printf.printf "really_write_pdf\n%!"; let outname' = if args.linearize @@ -1953,6 +1953,7 @@ let really_write_pdf ?(encryption = None) mk_id pdf outname = Pdfwrite.pdf_to_file_options ~preserve_objstm:args.preserve_objstm ~generate_objstm:args.create_objstm + ~compress_objstm:(not is_decompress) false encryption mk_id pdf outname' end else @@ -2000,9 +2001,9 @@ let write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf = if args.squeeze then Cpdf.squeeze pdf; Pdf.remove_unreferenced pdf end; - really_write_pdf mk_id pdf outname + really_write_pdf ~is_decompress mk_id pdf outname | Some _ -> - really_write_pdf ~encryption mk_id pdf outname + really_write_pdf ~encryption ~is_decompress mk_id pdf outname end | Stdout -> let temp = Filename.temp_file "cpdflin" ".pdf" in @@ -2015,9 +2016,9 @@ let write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf = if args.squeeze then Cpdf.squeeze pdf; Pdf.remove_unreferenced pdf end; - really_write_pdf ~encryption mk_id pdf temp; + really_write_pdf ~encryption ~is_decompress mk_id pdf temp; | Some _ -> - really_write_pdf ~encryption mk_id pdf temp + really_write_pdf ~encryption ~is_decompress mk_id pdf temp end; let temp_file = open_in_bin temp in try diff --git a/cpdfmanual.pdf b/cpdfmanual.pdf index c74b4eb..1588aea 100644 Binary files a/cpdfmanual.pdf and b/cpdfmanual.pdf differ diff --git a/cpdfmanual.tex b/cpdfmanual.tex index b5c69f0..cbd5080 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -934,7 +934,7 @@ PDF, use: \begin{framed} \small\verb!cpdf -decompress in.pdf -o out.pdf! \end{framed} - \noindent If \cpdf\ finds a compression type it can't cope with, the stream is left compressed. + \noindent If \cpdf\ finds a compression type it can't cope with, the stream is left compressed. When using \texttt{-decompress}, object streams are not compressed. \section{Compressing a Document} \index{compressing} To compress the streams in a PDF file, use: