Problems with GhostScript and nconvert

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: helmut, XnTriq, xnview

goulding
Posts: 9
Joined: Fri Jul 18, 2008 2:13 am
Location: boston, ma

Problems with GhostScript and nconvert

Post by goulding »

I have GhostScript 8.53 installed. When I open the PDF-Sample.pdf file in XnView it opens fine, but when I try to convert the same file using NConvert, I receive the following error:

Code: Select all

** NCONVERT v5.75 (c) 1991-2010 Pierre-E Gougelet (Sep  7 2010/11:49:02) **
        Version for Windows Xp/Vista/7 x64  (All rights reserved)
** This is a freeware software (for non commercial use)

  Error: Don't know how to read this picture (C:\CmdApps\_tests\PDF-Sample.pdf)

Conversion of C:\CmdApps\_tests\PDF-Sample.pdf into test.jpg OK
I have tried setting the windows environment "System Variables" XNVIEW_GS_DLL to point to my "gsdll32.dll" file and XNVIEW_GS_LIB to "gsdll32.lib" but I still receive the same error.

Any assistance would be appreciated,

Thanks,
Ken
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

I have gs 8.71, and no prolem with NConvert.
Could you try to update gs?
Pierre.
goulding
Posts: 9
Joined: Fri Jul 18, 2008 2:13 am
Location: boston, ma

Re: Problems with GhostScript and nconvert

Post by goulding »

Hi Pierre,

Unfortunately it may not be that easy to upgrade GhostScript for all deployment computers.

Can you think why XnView would recognize it and be able to use it when NConvert does not?

Thanks,
Ken
goulding
Posts: 9
Joined: Fri Jul 18, 2008 2:13 am
Location: boston, ma

Re: Problems with GhostScript and nconvert

Post by goulding »

FYI, here's the command I'm using:

Code: Select all

nconvert -xall -out jpeg -o test.jpg "C:\CmdApps\_tests\PDF-Sample.pdf" >out.txt 2>>err.txt
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

goulding wrote: Can you think why XnView would recognize it and be able to use it when NConvert does not?
You use XnView 1.97.8?
Pierre.
goulding
Posts: 9
Joined: Fri Jul 18, 2008 2:13 am
Location: boston, ma

Re: Problems with GhostScript and nconvert

Post by goulding »

Yes, 1.97.8
goulding
Posts: 9
Joined: Fri Jul 18, 2008 2:13 am
Location: boston, ma

Re: Problems with GhostScript and nconvert

Post by goulding »

I just tried installing gs 8.71 (I think I can just reference the dll and the lib file without affecting other applications that use GhostScript).

However that didn't change anything. I'm still getting the same error message.

I'm using the windows environment "System Variables" XNVIEW_GS_DLL to point to my "gsdll32.dll" file and XNVIEW_GS_LIB to "gsdll32.lib" in the gs8.71 bin folder.

FYI the older version of NConvert (version 5.00) works fine even if I delete the system variables (presumably its still using the older GS).

Older version:
** NCONVERT v5.00 (c) 1991-2008 Pierre-E Gougelet (Jul 21 2008/09:23:24) **
Version for Windows NT/9x/2000/Xp/Vista (All rights reserved)

Current version:
** NCONVERT v5.75 (c) 1991-2010 Pierre-E Gougelet (Sep 7 2010/11:49:02) **
Version for Windows Xp/Vista/7 x64 (All rights reserved)
goulding
Posts: 9
Joined: Fri Jul 18, 2008 2:13 am
Location: boston, ma

Re: Problems with GhostScript and nconvert

Post by goulding »

I just tried another test using the 32 bit version of NConvert 5.75. That also works, so I think we can safely say its a 64 bit issue.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

Ok, if you use NConvert x64, you should have GS x64 too!
Pierre.
User avatar
khaledhawari
Posts: 11
Joined: Tue Mar 06, 2012 8:41 am

Re: Problems with GhostScript and nconvert

Post by khaledhawari »

Hello,

i have the following environment :

- Windows server 2008 R2 (64-bit version) installed on a VM
- Ghostscript 8.71 (32-bit)
- Nconvert 5.62 (32-bit)
- both nconvert and gs are defined in environment variables

i am trying to convert PDF to JPEG using any of the following commands :

- nconvert -use_cie -org_depth -dpi 72 -q 100 -thumb 800 800 -overwrite -out jpeg -in pdf -o
- nconvert -use_cie -org_depth -page 0 -q 50 -dpi 72 -resize 100% 100% -out jpeg -o
- nconvert -use_cie -org_depth -out jpeg -o

all leading to the same error:

C:\Users\Administrator>nconvert -use_cie -org_depth -dpi 72 -q 100 -thumb 800 80
0 -overwrite -out jpeg -in pdf -o C:\Users\Administrator\Desktop\30821.jpeg C:\U
sers\Administrator\Desktop\30821.pdf
** NCONVERT v5.62 (c) 1991-2010 Pierre-E Gougelet (Apr 22 2010/17:32:06) **
Version for Windows NT/9x/2000/Xp/Vista (All rights reserved)
** This is a freeware software (for non commercial use)

Error: Don't know how to read this picture (C:\Users\Administrator\Desktop\308
21.pdf)

As i have read, this error appears when Nconvert is not able to find GS, but i am able to call both applications from command line. so i removed both applications and installed the 64-bit versions of each but to no avail, i kept on having the same error.

i then tired the 32 and 64-bit versions of Nconvert 6.01 and still same result

The weird part is , my PHP application calls nconvert using the exec function to convert PDF to jpeg, and when i upload a PDF via my application it is able to convert to JPEG!
Yet when i run the exact same command from command line, i receive the above error!

i tried the command line on a physical windows server 2008 with the same setup and it works fine!!

Any help on how to tackle this issue would be greatly appreciated ! thanks in advance
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

Do you have tried last version of NConvert & ghostscript?
Pierre.
User avatar
khaledhawari
Posts: 11
Joined: Tue Mar 06, 2012 8:41 am

Re: Problems with GhostScript and nconvert

Post by khaledhawari »

Hey Pierre,

I have tried the latest versions :

- ghostscript 9.02 32-bit
- nconvert 6.05 32-bit

and still same problem
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

Houps, i have not seen that
The weird part is , my PHP application calls nconvert using the exec function to convert PDF to jpeg, and when i upload a PDF via my application it is able to convert to JPEG!
Yet when i run the exact same command from command line, i receive the above error!

i tried the command line on a physical windows server 2008 with the same setup and it works fine!!
nconvert use registry to find gs, so if you launch it with command line or php, it's the same for me...
For a jpeg file, no problem?
Pierre.
User avatar
khaledhawari
Posts: 11
Joined: Tue Mar 06, 2012 8:41 am

Re: Problems with GhostScript and nconvert

Post by khaledhawari »

hey Pierre,

I was able to convert JPG to PNG normally from command line...


is there a way i can track how nconvert is looking for gs in registry ? can i provide you with my registry keys or anything to help ?
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

I can send you a version with output debug information? Send me your email by PM
Pierre.
Post Reply