Fixed nobble bug

This commit is contained in:
John Whitington 2014-10-22 11:48:20 +01:00
parent 639af8527e
commit 268979835f
1 changed files with 17 additions and 18 deletions

View File

@ -1,5 +1,5 @@
(* cpdf command line tools *)
let demo = false
let demo = true
let noncomp = false
let major_version = 1
let minor_version = 8
@ -557,7 +557,6 @@ let rec decrypt_if_necessary (_, _, _, user_pw, owner_pw) op pdf =
soft_error "Failed to decrypt file: wrong password?"
let nobble pdf =
flprint "nobble\n";
if not demo then pdf else
Cpdf.process_pages (Cpdf.nobble_page pdf) pdf (ilist 1 (Pdfpage.endpage pdf))
@ -1929,7 +1928,7 @@ let write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf =
| File outname ->
begin match encryption with
None ->
ignore (nobble pdf);
let pdf = nobble pdf in
if not is_decompress then
begin
ignore (Cpdf.recompress_pdf pdf);
@ -1944,7 +1943,7 @@ let write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf =
let temp = Filename.temp_file "cpdflin" ".pdf" in
begin match encryption with
None ->
ignore (nobble pdf);
let pdf = nobble pdf in
if not is_decompress then
begin
ignore (Cpdf.recompress_pdf pdf);