summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpdftool.pl28
1 files 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<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
defaults, B<PDFTool> outputs a PostScript document; see the B<--pdf> to
-get a PDF instead.
+get a PDF instead. Note that because of 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.
By default, B<PDFTool> 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<pdftops> 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<http://www.tardis.ed.ac.uk/~ajcd/psutils/>).
+=item *
+
+Requires L<PSUtils|http://www.tardis.ed.ac.uk/~ajcd/psutils/> installed
+and available via the command line.
+
+=item *
-Requires GhostScript installed and available via the command C<gs>
-(L<http://ghostscript.com/>).
+Requires L<GhostScript|http://ghostscript.com/> installed and available
+via the command C<gs>.
+
+=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;