PDFCROP 1.10, 2008/07/16 - Copyright (c) 2002-2008 by Heiko Oberdiek.
'-' is not recognized as an internal or external command,
operable program or batch file.
!!! Error: Execution of ghostscript failed: 256
What do these mean? I cannot use the tool totally.
Thanks.
Get a better Perl port. The implementation of open("-|") is broken,
if I understand the Perl documentation correctly.
My developing environment is Linux, thus it's difficult for me
to try alternatives for the broken Perl ports on Windows.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
Thanks Heiko~
But I still cannot get it works after my reinstalling Perl port. I use
ActivePeal v5.10.0.1003 as my port, and this is the recommand port in
CPAN. Is there any better alternatives for this distribution?
BTW, your former PDFCROPER v1.5.1 works pretty fine here, though lack
of some usefull functions, it's a good alternative for this newer
pdfcrop.pl.
Yours
Hsiao-nan Cheung
How can the *port* be considered to be broken if the Perl
documentation itself (*not* the documentation of the port)
acknowledges the limitation (see: http://perldoc.perl.org/perlfork.html)?
> The implementation of open("-|") is broken,
According to http://perldoc.perl.org/perlfork.html Perl 5.10.0 does
*not* implement open("-|") at all. Maybe one needs a later version
of Perl, not just another port of Perl 5.10.0?
open("-|") is described in my very old book of Perl:
L. Wall, T. Christiansen, R.L. Schwartz, "Programming Perl", O'Reilly
& Associates, Inc., 2nd edition, 1996.
Many thanks for pointing me to the perlfork documentation.
It says:
| Forking pipe open() not yet implemented
|
| The open(FOO, "|-") and open(BAR, "-|") constructs
| are not yet implemented.
Thus it *is* a deficiency of the "newer" Perl versions
since 5.8.0.
But the page describes a workaround;
| This limitation can be easily worked around in new code
| by creating a pipe explicitly.
I will look at it, thus there is hope for pdfcrop.
And if I fail, there is another hope:
| Forking pipe open() constructs will be supported in future.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
> "Christian Stapfer" <nob...@nowhere.nil> wrote:
>
> > (see: http://perldoc.perl.org/perlfork.html)?
> Many thanks for pointing me to the perlfork documentation.
> It says:
> But the page describes a workaround;
>
> | This limitation can be easily worked around in new code
> | by creating a pipe explicitly.
>
> I will look at it, thus there is hope for pdfcrop.
Update of pdfcrop v1.11 is on its way to CTAN, please test.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
pdfcrop seems to work fine with Perl 5.10.0 shipping with Cygwin:
C:\DOCUME~1\mhe\Desktop\test>perl -v
This is perl, v5.10.0 built for cygwin-thread-multi-64int
(with 6 registered patches, see perl -V for more detail)
Copyright 1987-2007, Larry Wall
C:\DOCUME~1\mhe\Desktop\test>perl pdfcrop.pl --help
PDFCROP 1.10, 2008/07/16 - Copyright (c) 2002-2008 by Heiko Oberdiek.
C:\test>perl pdfcrop.pl test.pdf
PDFCROP 1.10, 2008/07/16 - Copyright (c) 2002-2008 by Heiko Oberdiek.
==> 1 page written on `test-crop.pdf'.
This time it halts during its run.... No output, no end, but only a
tmp-pdfcrop-xxxxx.tex ^_^
Result of --verbose and --debug?
Ghostscript can process the PDF file?
Yours sincerely
Heiko <ober...@uni-freiburg.de>
None of these parameters.... It just like
D:\MiKTeX 2.7\scripts\pdfcrop\perl>pdfcrop xmu.pdf
PDFCROP 1.11, 2008/07/22 - Copyright (c) 2002-2008 by Heiko Oberdiek.
And then no response.
I've test my gs, it's okay.
Yours
Hsiao-nan
> > Result of --verbose and --debug?
> > Ghostscript can process the PDF file?
>
> None of these parameters.... It just like
These parameters are *VERY* important, because
they provide additional information for finding the
cause of your problem.
> D:\MiKTeX 2.7\scripts\pdfcrop\perl>pdfcrop xmu.pdf
> PDFCROP 1.11, 2008/07/22 - Copyright (c) 2002-2008 by Heiko Oberdiek.
>
>
> And then no response.
>
> I've test my gs, it's okay.
Option --debug prints the comand line call of ghostscript.
Try it. Does it work and prints %%BoundingBox lines?
Anyway, the workaround has lots of disadvantages (error
detection, ...). I had to add workarounds for the workaround. :-(
pdfcrop 1.12 is on its way to CTAN, please test again.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
I'm really sorry.... Due to my misunderstanding, I didn't add those
parameters...
I cannot find pdfcrop v1.12 on CTAN yet, maybe I'm looking at it on a
wrong mirror?
Here is v1.11's screen print:
D:\MiKTeX 2.7\scripts\pdfcrop\perl>pdfcrop --verbose --debug xmu.pdf
PDFCROP 1.11, 2008/07/22 - Copyright (c) 2002-2008 by Heiko Oberdiek.
* Input file: xmu.pdf
* Output file: xmu-crop.pdf
* Margins: 0 0 0 0
* Running ghostscript for BoundingBox calculation ...
* Ghostscript call: mgs -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop -f
xmu.pdf
When I call pdfcrop --verbose --debug --gscmd gswin32c xmu.pdf, it is
PDFCROP 1.11, 2008/07/22 - Copyright (c) 2002-2008 by Heiko Oberdiek.
* Input file: xmu.pdf
* Output file: xmu-crop.pdf
* Margins: 0 0 0 0
* Running ghostscript for BoundingBox calculation ...
* Ghostscript call: gswin32c -sDEVICE=bbox -dBATCH -dNOPAUSE -c save
pop -f xmu.pdf
Sincerely Greeting
Hsiao-nan
> I cannot find pdfcrop v1.12 on CTAN yet, maybe I'm looking at it on a
> wrong mirror?
The upload procedure for CTAN is too slow. For a short time pdfcrop.pl
is now available at:
http://www.informatik.uni-freiburg.de/~oberdiek/tmp/pdfcrop.pl
> * Running ghostscript for BoundingBox calculation ...
> * Ghostscript call: mgs -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop -f
> xmu.pdf
>
> When I call pdfcrop --verbose --debug --gscmd gswin32c xmu.pdf, it is
> * Running ghostscript for BoundingBox calculation ...
> * Ghostscript call: gswin32c -sDEVICE=bbox -dBATCH -dNOPAUSE -c save
> pop -f xmu.pdf
Thanks. I have added a "waitpid" in v1.12, perhaps this helps.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
It still halts at the same place. Maybe I've mentioned before, the
pdfcroper v1.5.1 works fine. From changelog,
2005/03/11 v1.7: Support of spaces in file names
(open("-|") is used for ghostscript call).
And is it the prob?
Thanks a lot^_^
Yours
Hsiao-nan
> It still halts at the same place. Maybe I've mentioned before, the
> pdfcroper v1.5.1 works fine. From changelog,
> 2005/03/11 v1.7: Support of spaces in file names
> (open("-|") is used for ghostscript call).
> And is it the prob?
No, Perl is the problem, newer versions do not support
open("-|") any more in a portable way. And obviously
the workaround, given in the documenation isn't working.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
Then what should I do is waiting for a newer Perl that support
open("-|")? Then now let me turn back to the v1.51...
Thanks a lot, Heiko ^_^
Yours
Hsiao-nan
> On Jul 23, 1:43 pm, Heiko Oberdiek <oberd...@uni-freiburg.de> wrote:
> > Hsiao-nan Cheung <nihea...@gmail.com> wrote:
> > > It still halts at the same place. Maybe I've mentioned before, the
> > > pdfcroper v1.5.1 works fine. From changelog,
> > > 2005/03/11 v1.7: Support of spaces in file names
> > > (open("-|") is used for ghostscript call).
> > > And is it the prob?
> >
> > No, Perl is the problem, newer versions do not support
> > open("-|") any more in a portable way. And obviously
> > the workaround, given in the documenation isn't working.
> >
> Then what should I do is waiting for a newer Perl that support
> open("-|")? Then now let me turn back to the v1.51...
No need, next version v1.13 is on its way to CTAN
(the temporary place is already updated, see one of
my previous postings).
I have removed the open("-|") and fork() stuff and replaced it by
the method of 1.5. The problems there (spaces, unknown shell
behaviour in open-pipe call, ...) are solved by linking/copying
unsafe file names to a temporary file with safe file name.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
lol, it finally works~~
Thank you VERY VERY much, for solving my such a problem.
Yours
Hsiao-nan
Oh, great, .. yes it works on my system (Vista/ActivePerl/MikTeX), too:
many thanks! (And my apologies for having provided the link
to the open("-|")-fix that apparently does not work).
Regards,
Christian Stapfer
Also now working here: WinXP Pro, MikTeX 2.7, perl 5.10.0 (ActivePerl)
--
Joseph Wright
Thanks to all for their feedback.
> many thanks! (And my apologies for having provided the link
> to the open("-|")-fix that apparently does not work).
That's not your fault. Thanks anyway.
Portability is a very difficult matter and
file names with special characters are evil.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
> Portability is a very difficult matter and
> file names with special characters are evil.
>
And Evil has too many Priests and Followers and they are very
resourceful :-)
I feel a kind of guilt that pdfcrop never broke for me :-)
Victor