summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/generic/pdfcrop/README10
-rwxr-xr-xMaster/texmf-dist/scripts/pdfcrop/pdfcrop.pl27
2 files changed, 29 insertions, 8 deletions
diff --git a/Master/texmf-dist/doc/generic/pdfcrop/README b/Master/texmf-dist/doc/generic/pdfcrop/README
index b088c7e5d6a..a91ee46f861 100644
--- a/Master/texmf-dist/doc/generic/pdfcrop/README
+++ b/Master/texmf-dist/doc/generic/pdfcrop/README
@@ -1,4 +1,4 @@
-README for pdfcrop 2008/07/16 v1.10
+README for pdfcrop 2008/07/22 v1.11
TABLE OF CONTENTS
=================
@@ -109,6 +109,7 @@ Scott Pakin <pakin at uiuc.edu>
Ionut Georgescu
Yves J\"ager
R (Chandra) Chandrasekhar
+Christian Stapfer
I. QUESTIONS, SUGGESTED IMPROVEMENTS
====================================
@@ -124,8 +125,9 @@ My environment for developing and testing:
J. KNOWN PROBLEMS
=================
-* Perl must support open("-|"). Not every perl port supports this
- for older windows (win95, win98).
+* Some Perl versions (newer Perl on Windows) miss open("-|").
+ This should be fixed in version 1.11 by a workaround found in
+ http://perldoc.perl.org/perlfork.html.
K. HISTORY
==========
@@ -144,6 +146,7 @@ K. HISTORY
2008/04/05 v1.9: Options --resolution and --bbox added.
2008/07/16 v1.10: Support for XeTeX added with new options
--pdftex, --xetex, --xetexcmds.
+2008/07/22 v1.11: Workaround for open("-|").
L. TODO
=======
@@ -151,4 +154,3 @@ L. TODO
* Documentation in other formats, eg. man or info pages.
* Improved error checking.
* Units support for option --margins.
-* Perhaps other drivers than pdfTeX, especially VTeX.
diff --git a/Master/texmf-dist/scripts/pdfcrop/pdfcrop.pl b/Master/texmf-dist/scripts/pdfcrop/pdfcrop.pl
index 495cbfeb1e1..99d7af267a0 100755
--- a/Master/texmf-dist/scripts/pdfcrop/pdfcrop.pl
+++ b/Master/texmf-dist/scripts/pdfcrop/pdfcrop.pl
@@ -22,8 +22,8 @@ $^W=1; # turn warning on
#
my $file = "pdfcrop.pl";
my $program = uc($&) if $file =~ /^\w+/;
-my $version = "1.10";
-my $date = "2008/07/16";
+my $version = "1.11";
+my $date = "2008/07/22";
my $author = "Heiko Oberdiek";
my $copyright = "Copyright (c) 2002-2008 by $author.";
#
@@ -44,6 +44,7 @@ my $copyright = "Copyright (c) 2002-2008 by $author.";
# 2008/04/05 v1.9: Options --resolution and --bbox added.
# 2008/07/16 v1.10: Support for XeTeX added with new options
# --pdftex, --xetex, and --xetexcmd.
+# 2008/07/22 v1.11: Workaround for open("-|").
### program identification
my $title = "$program $version, $date - $copyright\n";
@@ -345,8 +346,26 @@ if ($::opt_bbox) {
@bbox = ($1, $2, $3, $4);
}
my $page = 0;
-my $pid = open(KID_TO_READ, "-|");
-if ($pid) { # parent
+# simulate open(FOO, "-|")
+# code from http://perldoc.perl.org/perlfork.html
+sub pipe_from_fork ($) {
+ my $parent = shift;
+ pipe $parent, my $child or die "!!! Error: Cannot open pi;e!\n";
+ my $pid = fork();
+ die "!!! Error: fork() failed: $!" unless defined $pid;
+ if ($pid) {
+ close $child;
+ }
+ else {
+ close $parent;
+ open(STDOUT, ">&=" . fileno($child))
+ or die "!!! Error: Redirecting STDOUT failed!\n";
+ }
+ $pid;
+}
+# my $pid = open(KID_TO_READ, "-|");
+# if ($pid) { # parent
+if (pipe_from_fork(*KID_TO_READ)) {
while (<KID_TO_READ>) {
my $bb = ($::opt_hires) ? "%%HiResBoundingBox" : "%%BoundingBox";
next unless