summaryrefslogtreecommitdiff
path: root/doc/pspdf.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-10 16:10:28 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-10 16:10:28 -0700
commitf13effec22fe78e32b0802dbd66610ed4c80c2a0 (patch)
tree04de93a6d54f0ff90bc89f69dbb72b95dc850879 /doc/pspdf.pl
parentc11e23004f1be93779017ca71848ed0901486f82 (diff)
downloadnasm-f13effec22fe78e32b0802dbd66610ed4c80c2a0.tar.gz
doc: add the option to generate an uncompressed PDF
An uncompressed PDF is about twice as big, but if one is using an external compression program (e.g. .pdf.xz) it compresses far better. Use it for the RPM specfile. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'doc/pspdf.pl')
-rwxr-xr-xdoc/pspdf.pl17
1 files changed, 14 insertions, 3 deletions
diff --git a/doc/pspdf.pl b/doc/pspdf.pl
index 454c031c..961a8ae1 100755
--- a/doc/pspdf.pl
+++ b/doc/pspdf.pl
@@ -5,10 +5,21 @@
use strict;
+my $compress = 1;
+
+while ($ARGV[0] =~ /^-(.*)$/) {
+ my $opt = $1;
+ shift @ARGV;
+
+ if ($opt eq '-nocompress') {
+ $compress = 0;
+ }
+}
+
my ($in, $out) = @ARGV;
if (!defined($out)) {
- die "Usage: $0 infile outfile\n";
+ die "Usage: $0 [-nocompress] infile outfile\n";
}
# Remove output file
@@ -20,8 +31,8 @@ exit 0 if ( !$r && -f $out );
# 2. ps2pdf (from Ghostscript)
my $r = system('ps2pdf', '-dOptimize=true', '-dEmbedAllFonts=true',
- '-dUseFlateCompression=true',
- $in, $out);
+ '-dCompressPages=' . ($compress ? 'true' : 'false'),
+ '-dUseFlateCompression=true', $in, $out);
exit 0 if ( !$r && -f $out );
# 3. pstopdf (BSD/MacOS X utility)