Skip to content

Commit

Permalink
Add --compress and --minify options.
Browse files Browse the repository at this point in the history
  • Loading branch information
deven committed Jun 24, 2022
1 parent a357fc9 commit 2bc377e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/pdf_data
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ our @option_list = (
"find_bbox" => \( our $find_bbox = "" ),
"new_bbox" => \( our $new_bbox = "" ),

"compress" => \( our $compress = 0 ),
"decompress" => \( our $decompress = "" ),
"minify" => \( our $minify = 0 ),

"help|h|?" => \( our $print_help = "" ),
"version|V" => \( our $print_version = "" ),
Expand All @@ -65,7 +67,9 @@ Options:
--find_bbox Find the bounding box of the PDF file.
--new_bbox Generate a new bounding box for the PDF file.
--compress Compress all PDF stream objects.
--decompress Decompress all compressed PDF stream objects.
--minify Remove whitespace/comments from content streams.
--help (-h) Print this help message.
--version (-V) Print the version number of this program.
Expand Down Expand Up @@ -129,7 +133,8 @@ if ($dump) {
}

# Generate output PDF.
$pdf->{-compress} = $pdf->{-minify} = 0;
$pdf->{-compress} = $compress;
$pdf->{-decompress} = 1 if $decompress;
$pdf->{-minify} = $minify;
$pdf->write_pdf($output_file, $time);
}

0 comments on commit 2bc377e

Please sign in to comment.