diff options
author | H. Peter Anvin <hpa@zytor.com> | 2017-04-10 16:10:28 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2017-04-10 16:10:28 -0700 |
commit | f13effec22fe78e32b0802dbd66610ed4c80c2a0 (patch) | |
tree | 04de93a6d54f0ff90bc89f69dbb72b95dc850879 /doc/pspdf.pl | |
parent | c11e23004f1be93779017ca71848ed0901486f82 (diff) | |
download | nasm-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-x | doc/pspdf.pl | 17 |
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) |