From 8d41af436fd6eae28a6f680258811a3c4f89de38 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 6 Jan 2012 18:55:40 +0100 Subject: gs/pswrite limitation --- pdftool.pl | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pdftool.pl b/pdftool.pl index a0566a4..2d6c320 100755 --- a/pdftool.pl +++ b/pdftool.pl @@ -53,7 +53,8 @@ is I. If no output file is given, or if a single hyphen-minus (I<->) is given as file name, B sends the data to the standard output. By defaults, B outputs a PostScript document; see the B<--pdf> to -get a PDF instead. +get a PDF instead. Note that because of a L of C with +the C device, the PostScript output might not be suitable for uses other than printing. By default, B rotates the pages in order to ensure that your document will always be printable using your favorite duplex mode for portrait @@ -227,15 +228,25 @@ C<< ssh remote pdftool.pl -cpA4 --book -2 -b2cm -m-1cm < in.pdf | =head1 REQUIREMENTS +=over 4 + +=item * + Requires C available via the command line (only if the input is a PDF). Depending on your own version of this program, you might need to hack the source yourself to remove the C<-origpagesizes> option :-/. -Requires PSUtils installed and available via the command line -(L). +=item * + +Requires L installed +and available via the command line. + +=item * -Requires GhostScript installed and available via the command C -(L). +Requires L installed and available +via the command C. + +=back =head1 AUTHOR @@ -432,7 +443,7 @@ sub pdftops { my $OUT; # - # Detect filetype + # Detect filetype, using input file's magic number # # To avoid to seek into IN, it gonna be copied from WRITE to READ in # the background, once the filetype has been read @@ -441,7 +452,6 @@ sub pdftops { my ($READ, $WRITE); pipe $READ, $WRITE or die "Cannot pipe: $!"; - # Detect the file type of the input file from its magic number $_ = <$IN>; print $WRITE ($_) or die "Cannot print: $!"; if (defined $_ && $_ =~ /^%!/) { @@ -477,7 +487,7 @@ sub pdftops { # Need to copy the whole input to an auxiliary file, since # conversion from PDF to PS requires random access to the data - $infile = catfile( tmpdir(), "pdftool-stdin-$$." . lc $filetype ); + $infile = catfile( tmpdir(), "pdftool-stdin-$$.". lc $filetype ); open my $AUX, '>', $infile or die "Cannot write into `" .$infile. "': $!\n"; @@ -528,7 +538,7 @@ sub pdftops { } # Convert to PS - # TODO: use gs & pswrite the day it'll handle fonts correctly + # TODO: use gs & pswrite the day it'll handle fonts properly my @cmd = ('pdftops', '-origpagesizes', $infile, '-'); push @cmd, '-f', $first if defined $first; push @cmd, '-l', $last if defined $last; -- cgit v1.2.3