summaryrefslogtreecommitdiffstats
path: root/pdftool.pl
diff options
context:
space:
mode:
Diffstat (limited to 'pdftool.pl')
-rwxr-xr-xpdftool.pl25
1 files changed, 14 insertions, 11 deletions
diff --git a/pdftool.pl b/pdftool.pl
index ca9f2a5..fd8e4c7 100755
--- a/pdftool.pl
+++ b/pdftool.pl
@@ -52,7 +52,7 @@ is I<a4>.
If no output file is given, or if a single hyphen-minus (I<->) is given as
file name, B<PDFTool> sends the data to the standard output. By
-default, B<PDFTool> outputs a PDF document; see B<--ps> to
+default, B<PDFTool> outputs a PDF document; Use B<--ps> to
get a PostScript instead.
B<PDFTool> does the following passes on the input document:
@@ -182,9 +182,6 @@ on your screen.
By default, B<PDFTool> outputs a PDF document; use this flag if
you want a PostScript instead.
-Note that due to a L<known limitation|http://www.ghostscript.com/doc/current/Issues.htm#Known_Limitations> of C<gs> with
-the C<pswrite> device, the PostScript output might not be suitable for uses other than printing.
-
=item B<--column>
@@ -531,8 +528,7 @@ sub pdftops {
}
# Convert to PS
- # TODO: use gs & pswrite the day it'll handle fonts properly
- # (the flag `-origpagesizes' seems not to be portable)
+ # TODO: use gs & ps2write, more portable
my @cmd = ('pdftops', '-origpagesizes', $infile, '-');
push @cmd, '-f', $first if defined $first;
push @cmd, '-l', $last if defined $last;
@@ -851,11 +847,18 @@ sub pswrite {
$pagedevice = "/PageSize [$outwidth $outheight]";
}
- my @device = ('-sDEVICE=pdfwrite');
- @device = ('-sDEVICE=pswrite', '-dLanguageLevel=3')
- if defined $psout;
- my @cmd = (@gs, @device, '-dQUIET', '-dBATCH', '-dNOPAUSE',
- '-sOutputFile=%stdout%', '-dAutoRotatePages=/None',
+ my $device = '-sDEVICE=pdfwrite';
+ $device = '-sDEVICE=ps2write' if defined $psout;
+ my @cmd = (@gs, '-dQUIET', '-dBATCH', '-dNOPAUSE', $device,
+ '-dAutoRotatePages=/None',
+ '-dDetectDuplicateImages=false',
+ # Preserve image quality
+ '-dAutoFilterColorImages=false',
+ '-dAutoFilterGrayImages=false',
+ '-dColorImageFilter=/FlateEncode',
+ '-dGrayImageFilter=/FlateEncode',
+ '-dMonoImageFilter=/FlateEncode',
+ '-sOutputFile=%stdout%',
'-c', "<< $pagedevice >> setpagedevice",
'-f', '-');