Discussion:
pdfcrop problem on Windows
(too old to reply)
Jinsong Zhao
2018-09-13 09:40:35 UTC
Permalink
Hi there,

I use pdfcrop on Windows 10. I have installed the TeXLive 2017 full
distribution. It ships with a Ghostscript 32-bit version. Now, the
version of Ghostscript is 9.23.

I also installed a Ghostscript 64-bit 9.24 in the default place, i.e.,
C:\Program Files\gs\gs9.24\bin\gswin64c.exe

I try to use pdfcrop to crop a PDF file, named a.pdf, thus:
pdfcrop --gscmd gswin64c a.pdf

However, error appears. Then, I add --debug to the above command. I get
the following message.

<snipped>
* Running ghostscript for BoundingBox calculation ...
* Ghostscript call: gswin64c -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop
-f a.pdf
gs: Interpreter revision (924) does not match gs_init.ps revision (923).
* Cleanup
* Temporary files: tmp-pdfcrop-2352.tex
!!! Error: Ghostscript exited with error code 1!
<snipped>

The strange thing is the version of Ghostscript is mismatch.

I try to use:
pdfcrop --gscmd gswin32c a.pdf
all is OK.

I just wonder why pdfcrop try to use gs_init.ps in
...\2018\tlpkg\tlgs\Resource\Init when invoke the external gswin64c?

BTW, why pdfcrop does not reach the gs installed by TeXLive distribution?

Best,
Jinsong
Peter Flynn
2018-09-13 20:14:16 UTC
Permalink
Post by Jinsong Zhao
Hi there,
I use pdfcrop on Windows 10. I have installed the TeXLive 2017 full
distribution. It ships with a Ghostscript 32-bit version. Now, the
version of Ghostscript is 9.23.
I also installed a Ghostscript 64-bit 9.24 in the default place, i.e.,
C:\Program Files\gs\gs9.24\bin\gswin64c.exe
pdfcrop --gscmd gswin64c a.pdf
However, error appears. Then, I add --debug to the above command. I get
the following message.
<snipped>
* Running ghostscript for BoundingBox calculation ...
* Ghostscript call: gswin64c -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop
-f a.pdf
gs: Interpreter revision (924) does not match gs_init.ps revision (923).
That sounds like you only installed the binary for 9.24 and not the
support files as well.
Post by Jinsong Zhao
The strange thing is the version of Ghostscript is mismatch.
pdfcrop --gscmd gswin32c a.pdf
all is OK.
I just wonder why pdfcrop try to use gs_init.ps in
...\2018\tlpkg\tlgs\Resource\Init when invoke the external gswin64c?
Because it's programmed to?
Post by Jinsong Zhao
BTW, why pdfcrop does not reach the gs installed by TeXLive distribution?
Path errors, I expect. But I don't know how to fix those on Windows, you
have to mess with the registry.

///Peter
Jinsong Zhao
2018-09-15 09:53:39 UTC
Permalink
Post by Peter Flynn
Post by Jinsong Zhao
Hi there,
I use pdfcrop on Windows 10. I have installed the TeXLive 2017 full
distribution. It ships with a Ghostscript 32-bit version. Now, the
version of Ghostscript is 9.23.
I also installed a Ghostscript 64-bit 9.24 in the default place, i.e.,
C:\Program Files\gs\gs9.24\bin\gswin64c.exe
pdfcrop --gscmd gswin64c a.pdf
However, error appears. Then, I add --debug to the above command. I get
the following message.
<snipped>
* Running ghostscript for BoundingBox calculation ...
* Ghostscript call: gswin64c -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop
-f a.pdf
gs: Interpreter revision (924) does not match gs_init.ps revision (923).
That sounds like you only installed the binary for 9.24 and not the
support files as well.
The Windows version of Ghostscript installer don't install the support
files, it seems that they are automatically invoked from memory.
Post by Peter Flynn
Post by Jinsong Zhao
The strange thing is the version of Ghostscript is mismatch.
pdfcrop --gscmd gswin32c a.pdf
all is OK.
I just wonder why pdfcrop try to use gs_init.ps in
...\2018\tlpkg\tlgs\Resource\Init when invoke the external gswin64c?
Because it's programmed to?
Post by Jinsong Zhao
BTW, why pdfcrop does not reach the gs installed by TeXLive distribution?
Path errors, I expect. But I don't know how to fix those on Windows, you
have to mess with the registry.
In the registry of Windows, I don't find any clue with Ghostscript
32-bit version.

Another question, the OS type returned by pdfcrop seems to be determined
by the perl installed. The perl installed by TeXLive Windows version is
a 32-bit version. Even on 64-bit Windows, it also return the OS type
with MSWin32. So the script does not to search gswin64 that installed in
the default path.
Post by Peter Flynn
///Peter
Thanks a lot.

Best,
Jinsong

Loading...