From d1e03bbf11df9329f42821f623aa8c0dee599b30 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Sat, 4 Jul 2009 00:14:50 -0400 Subject: [PATCH] Bug 3390 Enabling ZIP compression in pdf generation to reduce file size Enabling compression gives a ~26% *reduction* over non-compressed Type 3 font embedding. ie. 4.5 K/pg (compressed graphic) vs. 17.5 K/pg (uncompressed Type 3 font) vs 111 K/pg (uncompressed graphic). It also appears that most other applications that export in pdf use compression by default. (OO Writer, etc.) So this approach appears justified. One could always add code to allow the user to select embedding mode and compression. Also correcting mode parameter value. Signed-off-by: Galen Charlton --- C4/Labels.pm | 14 +++++++------- labels/label-print-pdf.pl | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/C4/Labels.pm b/C4/Labels.pm index ce8f359530..b9b0dec6f9 100644 --- a/C4/Labels.pm +++ b/C4/Labels.pm @@ -44,9 +44,9 @@ BEGIN { &CreateTemplate &SetActiveTemplate &SaveConf &GetTextWrapCols &GetUnitsValue - &DrawSpineText - &DrawBarcode - &DrawPatronCardText + &DrawSpineText + &DrawBarcode + &DrawPatronCardText &get_printingtypes &GetPatronCardItems &get_layouts &get_barcode_types @@ -1165,7 +1165,7 @@ sub DrawBarcode { ySize => ( .02 * $height ), xSize => $xsize_ratio, hide_asterisk => 1, - mode => '', # the only other option here is Type3... + mode => 'graphic', # the only other option here is Type3... ); }; } @@ -1186,7 +1186,7 @@ sub DrawBarcode { ySize => ( .02 * $height ), xSize => $xsize_ratio, hide_asterisk => 1, - mode => '', # the only other option here is Type3... + mode => 'graphic', # the only other option here is Type3... ); }; } @@ -1208,7 +1208,7 @@ sub DrawBarcode { xSize => $xsize_ratio, hide_asterisk => 1, text => 0, - mode => '', # the only other option here is Type3... + mode => 'graphic', # the only other option here is Type3... ); }; } @@ -1297,7 +1297,7 @@ sub build_circ_barcode { # prolong => 2.96, xSize => .85, ySize => 1.3, - mode => '', # the only other option here is Type3... + mode => 'graphic', # the only other option here is Type3... ); }; } diff --git a/labels/label-print-pdf.pl b/labels/label-print-pdf.pl index 6f48170e1b..3534af2f30 100755 --- a/labels/label-print-pdf.pl +++ b/labels/label-print-pdf.pl @@ -112,6 +112,7 @@ print $cgi->header( -type => 'application/pdf', -attachment => 'barcode.pdf' ); prInitVars(); $| = 1; prFile(); # No args means to STDOUT +prCompress(1); # turn on zip compression which dramatically reduces file size prMbox( $lowerLeftX, $lowerLeftY, $upperRightX, $upperRightY ); # drawbox( $lowerLeftX, $lowerLeftY, $upperRightX, $upperRightY ); #do page border -- 2.39.5