check ghostscript working

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

Moderators: XnTriq, helmut, xnview

RobertoG
Posts: 21
Joined: Mon Apr 04, 2016 8:51 am

check ghostscript working

Post by RobertoG »

hi
i'm tryng to convert files and i get the error

Code: Select all

"D:\Files\XnView\nconvert.exe" -out pdf -multi -xall -quiet -D -overwrite -c 1  -o aaa.pdf ARCHIVIO_EC-----1006364382.pdf
my_error_exit...<Not a JPEG file: starts with 0x25 0x50>
my_error_exit...<Not a JPEG file: starts with 0x25 0x50>
  Error: Don't know how to read this picture (ARCHIVIO_EC-----1006364382.pdf)
i'm using x64 nconvert version

reading posts, i installed ghost script x64 9.19 , downloaded from site

i create 2 variables, as suggested in old post:

Code: Select all

XNVIEW_GS_DLL=C:\Program Files\gs\gs9.19\bin
XNVIEW_GS_LIB=C:\Program Files\gs\gs9.19\lib
but nothing seems to change, i get the same error

i tried to put lib and bin folders under xview/gs folder, as suggested somewhere in another post, but nothing...

There's a way to check if ghostscript tools is correctly recognised by nconvert?

Or if the problem is not related to gs?
I can open source pdf, so it seems not to be damaged
cday
XnThusiast
Posts: 4136
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: check ghostscript working

Post by cday »

Hello again,

A normal install of Ghostscript x64 should work correctly with NConvert x64, so I suggest you repeat the install before proceeding to ensure that everything is in order after the other changes you've tried!

Then check that the following code opens the attached 3-page image PDF:

Code: Select all

D:\Files\XnView\nconvert.exe -dpi 300 -xall -out pdf -c 1 -multi -o Success.pdf Test_PDF.pdf
The images in the test file have 1-bit depth, if the images in your file don't have 1-bit depth you will likely need to add a term to convert them, not absolutely sure without testing that. If your source file doesn't contain bitmap or vector images, that might also be a complication.

Presumably you can't upload or provide a link to a test file that you can't open?

I can't spend much time on this until later in the day. :wink:
Test_PDF.pdf
You do not have the required permissions to view the files attached to this post.
RobertoG
Posts: 21
Joined: Mon Apr 04, 2016 8:51 am

Re: check ghostscript working

Post by RobertoG »

i tried...

i've uninstalled old 9.09 i had on PC
i've deleted folder under xnview\plugins
i've removed and reinstalled 9.19

Code: Select all

D:\Files\test>..\XnView\nconvert.exe -dpi 300 -xall -out pdf -c 1 -multi -o Success.pdf Test_PDF.pdf
** NCONVERT v6.82 (c) 1991-2016 Pierre-E Gougelet (Jan  4 2016/21:36:59) **
        Version for Windows Xp/Vista/7 x64  (All rights reserved)
** This is freeware software (for non-commercial use)

my_error_exit...<Not a JPEG file: starts with 0x25 0x50>
my_error_exit...<Not a JPEG file: starts with 0x25 0x50>
  Error: Don't know how to read this picture (Test_PDF.pdf)

i can give you a file of mine, but let your test work before.. :)

BTW: there is a way to merge pdf with different page formats in a unique file (A4, letter, doesn't matter, it should only be viewed) ?

thanks
roberto
cday
XnThusiast
Posts: 4136
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: check ghostscript working

Post by cday »

Very strange, I'm using different versions of NConvert and Ghostscript but that shouldn't make any difference: looks as if your code may not be finding GS as you possibly suspected before, are you sure you are using NConvert x64 with GS x64? You might also look on your [C:] drive to check that GS has actually been installed, in case there is some Windows 10 issue??
RobertoG wrote:BTW: there is a way to merge pdf with different page formats in a unique file (A4, letter, doesn't matter, it should only be viewed) ?
I think you can simply use a series of [single or multi-page] files as input and obtain a single output file if you use -multi in your code, easy to test when you are able to run my code above...
cday
XnThusiast
Posts: 4136
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: check ghostscript working

Post by cday »

I've moved this edit I added to my previous post to a new post in case you missed it:

Another suggestion would be to install XnView Classic or MP, if you haven't already done so, which also use Ghostscript to open PDFs and see if they can open the above test PDF file...
RobertoG
Posts: 21
Joined: Mon Apr 04, 2016 8:51 am

Re: check ghostscript working

Post by RobertoG »

hi
i'll try installing XnView this afternoon

I'ts possible to generate a very verbose output, or a debug one, listing the tries of finding GS, end the errors?

i've installed gs919w64.exe
i don't have the 32bit versions, i think it's not a problem...

Code: Select all

C:\Program Files\gs\gs9.19>dir
 Volume in drive C is OS
 Volume Serial Number is F8AD-7E4E

 Directory of C:\Program Files\gs\gs9.19

04/18/2016  12:02 PM    <DIR>          .
04/18/2016  12:02 PM    <DIR>          ..
04/18/2016  12:02 PM    <DIR>          bin
04/18/2016  12:02 PM    <DIR>          doc
04/18/2016  12:02 PM    <DIR>          examples
04/18/2016  12:02 PM    <DIR>          lib
04/18/2016  12:02 PM    <DIR>          libpng
04/18/2016  12:02 PM    <DIR>          openjpeg
04/18/2016  12:02 PM            61,422 uninstgs.exe
04/18/2016  12:02 PM    <DIR>          zlib
               1 File(s)         61,422 bytes
               9 Dir(s)  187,281,666,048 bytes free

C:\Program Files\gs\gs9.19>cd bin

C:\Program Files\gs\gs9.19\bin>dir
 Volume in drive C is OS
 Volume Serial Number is F8AD-7E4E

 Directory of C:\Program Files\gs\gs9.19\bin

04/18/2016  12:02 PM    <DIR>          .
04/18/2016  12:02 PM    <DIR>          ..
03/23/2016  11:28 AM        15,945,216 gsdll64.dll
03/23/2016  11:28 AM             9,266 gsdll64.lib
03/23/2016  11:28 AM           173,568 gswin64.exe
03/23/2016  11:28 AM           163,840 gswin64c.exe
               4 File(s)     16,291,890 bytes
               2 Dir(s)  187,281,731,584 bytes free

C:\Program Files\gs\gs9.19\bin>dir ..\lib
 Volume in drive C is OS
 Volume Serial Number is F8AD-7E4E

 Directory of C:\Program Files\gs\gs9.19\lib

04/18/2016  12:02 PM    <DIR>          .
04/18/2016  12:02 PM    <DIR>          ..
03/23/2016  10:19 AM             4,269 acctest.ps
03/23/2016  10:19 AM            10,004 addxchar.ps
03/23/2016  10:19 AM             5,760 afmdiff.awk
03/23/2016  10:19 AM             2,172 align.ps
03/23/2016  10:19 AM               639 bj8.rpd
03/23/2016  10:19 AM             1,532 bj8gc12f.upp
03/23/2016  10:19 AM             1,531 bj8hg12f.upp
03/23/2016  10:19 AM             1,517 bj8oh06n.upp
03/23/2016  10:19 AM             1,525 bj8pa06n.upp
03/23/2016  10:19 AM             1,542 bj8pp12f.upp
03/23/2016  10:19 AM             1,530 bj8ts06n.upp
03/23/2016  10:19 AM             1,527 bjc610a0.upp
03/23/2016  10:19 AM             1,516 bjc610a1.upp
03/23/2016  10:19 AM             1,517 bjc610a2.upp
03/23/2016  10:19 AM             1,522 bjc610a3.upp
03/23/2016  10:19 AM             1,530 bjc610a4.upp
03/23/2016  10:19 AM             1,517 bjc610a5.upp
03/23/2016  10:19 AM             1,517 bjc610a6.upp
03/23/2016  10:19 AM             1,520 bjc610a7.upp
03/23/2016  10:19 AM             1,526 bjc610a8.upp
03/23/2016  10:19 AM             1,516 bjc610b1.upp
03/23/2016  10:19 AM             1,517 bjc610b2.upp
03/23/2016  10:19 AM             1,522 bjc610b3.upp
03/23/2016  10:19 AM             1,530 bjc610b4.upp
03/23/2016  10:19 AM             1,517 bjc610b6.upp
03/23/2016  10:19 AM             1,521 bjc610b7.upp
03/23/2016  10:19 AM             1,526 bjc610b8.upp
03/23/2016  10:19 AM             1,767 caption.ps
03/23/2016  10:19 AM             2,871 cat.ps
03/23/2016  10:19 AM            11,148 cbjc600.ppd
03/23/2016  10:19 AM            11,491 cbjc800.ppd
03/23/2016  10:19 AM             1,690 cdj550.upp
03/23/2016  10:19 AM             1,999 cdj690.upp
03/23/2016  10:19 AM             2,060 cdj690ec.upp
03/23/2016  10:19 AM             4,499 cid2code.ps
03/23/2016  10:19 AM               298 decrypt.ps
03/23/2016  10:19 AM             2,808 dnj750c.upp
03/23/2016  10:19 AM             1,975 dnj750m.upp
03/23/2016  10:19 AM             7,506 docie.ps
03/23/2016  10:19 AM             1,023 dvipdf
03/23/2016  10:19 AM                 2 EndOfTask.ps
03/23/2016  10:19 AM               639 eps2eps
03/23/2016  10:19 AM               583 eps2eps.bat
03/23/2016  10:19 AM               668 eps2eps.cmd
03/23/2016  10:19 AM               708 FAPIconfig-FCO
03/23/2016  10:19 AM             5,654 FCOfontmap-PCLPS3
03/23/2016  10:19 AM             4,239 FCOfontmap-PS3
03/23/2016  10:19 AM               311 font2c
03/23/2016  10:19 AM               126 font2c.bat
03/23/2016  10:19 AM               215 font2c.cmd
03/23/2016  10:19 AM            20,088 font2c.ps
03/23/2016  10:19 AM            18,371 font2pcl.ps
03/23/2016  10:19 AM             5,774 Fontmap.ATB
03/23/2016  10:19 AM             5,533 Fontmap.ATM
03/23/2016  10:19 AM             7,115 Fontmap.OS2
03/23/2016  10:19 AM             6,532 Fontmap.OSF
03/23/2016  10:19 AM            13,646 Fontmap.SGI
03/23/2016  10:19 AM            16,325 Fontmap.Sol
03/23/2016  10:19 AM             5,931 Fontmap.Ult
03/23/2016  10:19 AM            20,566 Fontmap.URW-136.T1
03/23/2016  10:19 AM            20,429 Fontmap.URW-136.TT
03/23/2016  10:19 AM            14,986 Fontmap.VMS
03/23/2016  10:19 AM             7,297 ghostpdf.cat
03/23/2016  10:19 AM             1,396 ghostpdf.inf
03/23/2016  10:19 AM            25,643 ghostpdf.ppd
03/23/2016  10:19 AM               514 ghostpdf.README
03/23/2016  10:19 AM               350 gsbj
03/23/2016  10:19 AM               141 gsbj.bat
03/23/2016  10:19 AM               352 gsdj
03/23/2016  10:19 AM               143 gsdj.bat
03/23/2016  10:19 AM               352 gsdj500
03/23/2016  10:19 AM               146 gsdj500.bat
03/23/2016  10:19 AM               353 gslj
03/23/2016  10:19 AM               144 gslj.bat
03/23/2016  10:19 AM               350 gslp
03/23/2016  10:19 AM               141 gslp.bat
03/23/2016  10:19 AM            20,735 gslp.ps
03/23/2016  10:19 AM               277 gsnd
03/23/2016  10:19 AM                92 gsnd.bat
03/23/2016  10:19 AM                95 gsndt.bat
03/23/2016  10:19 AM             2,642 gsnup.ps
03/23/2016  10:19 AM               184 gssetgs.bat
03/23/2016  10:19 AM               184 gssetgs32.bat
03/23/2016  10:19 AM               184 gssetgs64.bat
03/23/2016  10:19 AM                70 gst.bat
03/23/2016  10:19 AM                71 gstt.bat
03/23/2016  10:19 AM             2,227 gs_ce_e.ps
03/23/2016  10:19 AM             4,905 gs_cmdl.ps
03/23/2016  10:19 AM             2,639 gs_il2_e.ps
03/23/2016  10:19 AM             4,015 gs_kanji.ps
03/23/2016  10:19 AM             3,153 gs_ksb_e.ps
03/23/2016  10:19 AM             1,945 gs_l.xbm
03/23/2016  10:19 AM             2,751 gs_l.xpm
03/23/2016  10:19 AM             2,742 gs_lgo_e.ps
03/23/2016  10:19 AM             1,774 gs_lgx_e.ps
03/23/2016  10:19 AM             1,955 gs_l_m.xbm
03/23/2016  10:19 AM               945 gs_m.xbm
03/23/2016  10:19 AM             1,437 gs_m.xpm
03/23/2016  10:19 AM               955 gs_m_m.xbm
03/23/2016  10:19 AM             4,457 gs_pfile.ps
03/23/2016  10:19 AM               724 gs_rdlin.ps
03/23/2016  10:19 AM               594 gs_s.xbm
03/23/2016  10:19 AM               957 gs_s.xpm
03/23/2016  10:19 AM               604 gs_s_m.xbm
03/23/2016  10:19 AM               345 gs_t.xbm
03/23/2016  10:19 AM               605 gs_t.xpm
03/23/2016  10:19 AM               355 gs_t_m.xbm
03/23/2016  10:19 AM             2,503 gs_wl1_e.ps
03/23/2016  10:19 AM             2,502 gs_wl2_e.ps
03/23/2016  10:19 AM             2,520 gs_wl5_e.ps
03/23/2016  10:19 AM           228,143 ht_ccsto.ps
03/23/2016  10:19 AM            73,058 image-qa.ps
03/23/2016  10:19 AM             5,459 impath.ps
03/23/2016  10:19 AM               469 Info-macos.plist
03/23/2016  10:19 AM               792 jispaper.ps
03/23/2016  10:19 AM               123 jobseparator.ps
03/23/2016  10:19 AM             1,468 landscap.ps
03/23/2016  10:19 AM                59 level1.ps
03/23/2016  10:19 AM             3,744 lines.ps
03/23/2016  10:19 AM                95 lp386.bat
03/23/2016  10:19 AM                88 lp386r2.bat
03/23/2016  10:19 AM               145 lpgs.bat
03/23/2016  10:19 AM               138 lpr2.bat
03/23/2016  10:19 AM             5,470 lprsetup.sh
03/23/2016  10:19 AM             3,351 markhint.ps
03/23/2016  10:19 AM             1,751 markpath.ps
03/23/2016  10:19 AM            22,329 mkcidfm.ps
03/23/2016  10:19 AM             1,045 necp2x.upp
03/23/2016  10:19 AM             1,069 necp2x6.upp
03/23/2016  10:19 AM           147,503 opdfread.ps
03/23/2016  10:19 AM            10,531 packfile.ps
03/23/2016  10:19 AM             3,456 pcharstr.ps
03/23/2016  10:19 AM               698 pdf2dsc
03/23/2016  10:19 AM               318 pdf2dsc.bat
03/23/2016  10:19 AM             8,232 pdf2dsc.ps
03/23/2016  10:19 AM               909 pdf2ps
03/23/2016  10:19 AM               494 pdf2ps.bat
03/23/2016  10:19 AM               761 pdf2ps.cmd
03/23/2016  10:19 AM             1,276 PDFA_def.ps
03/23/2016  10:19 AM            11,571 pdfwrite.ps
03/23/2016  10:19 AM             1,812 PDFX_def.ps
03/23/2016  10:19 AM               498 pf2afm
03/23/2016  10:19 AM               271 pf2afm.bat
03/23/2016  10:19 AM               198 pf2afm.cmd
03/23/2016  10:19 AM            15,294 pf2afm.ps
03/23/2016  10:19 AM               516 pfbtopfa
03/23/2016  10:19 AM               256 pfbtopfa.bat
03/23/2016  10:19 AM             1,003 pfbtopfa.ps
03/23/2016  10:19 AM             1,521 pftogsf.bat
03/23/2016  10:19 AM             1,827 ppath.ps
03/23/2016  10:19 AM               404 pphs
03/23/2016  10:19 AM             6,851 pphs.ps
03/23/2016  10:19 AM             7,221 prfont.ps
03/23/2016  10:19 AM               395 printafm
03/23/2016  10:19 AM             4,896 printafm.ps
03/23/2016  10:19 AM            22,314 ps2ai.ps
03/23/2016  10:19 AM               740 ps2ascii
03/23/2016  10:19 AM               395 ps2ascii.bat
03/23/2016  10:19 AM               469 ps2ascii.cmd
03/23/2016  10:19 AM            44,795 ps2ascii.ps
03/23/2016  10:19 AM             2,794 ps2epsi
03/23/2016  10:19 AM             1,131 ps2epsi.bat
03/23/2016  10:19 AM             1,166 ps2epsi.cmd
03/23/2016  10:19 AM             8,568 ps2epsi.ps
03/23/2016  10:19 AM               272 ps2pdf
03/23/2016  10:19 AM               586 ps2pdf.bat
03/23/2016  10:19 AM               909 ps2pdf.cmd
03/23/2016  10:19 AM               215 ps2pdf12
03/23/2016  10:19 AM               404 ps2pdf12.bat
03/23/2016  10:19 AM               272 ps2pdf12.cmd
03/23/2016  10:19 AM               215 ps2pdf13
03/23/2016  10:19 AM               404 ps2pdf13.bat
03/23/2016  10:19 AM               272 ps2pdf13.cmd
03/23/2016  10:19 AM               215 ps2pdf14
03/23/2016  10:19 AM               404 ps2pdf14.bat
03/23/2016  10:19 AM               272 ps2pdf14.cmd
03/23/2016  10:19 AM             1,097 ps2pdfwr
03/23/2016  10:19 AM             1,460 ps2pdfxx.bat
03/23/2016  10:19 AM               647 ps2ps
03/23/2016  10:19 AM               501 ps2ps.bat
03/23/2016  10:19 AM               650 ps2ps.cmd
03/23/2016  10:19 AM               669 ps2ps2
03/23/2016  10:19 AM               528 ps2ps2.bat
03/23/2016  10:19 AM               650 ps2ps2.cmd
03/23/2016  10:19 AM                 5 quit.ps
03/23/2016  10:19 AM               215 ras1.upp
03/23/2016  10:19 AM               219 ras24.upp
03/23/2016  10:19 AM               214 ras3.upp
03/23/2016  10:19 AM               196 ras32.upp
03/23/2016  10:19 AM               220 ras4.upp
03/23/2016  10:19 AM               209 ras8m.upp
03/23/2016  10:19 AM             3,228 rinkj-2200-setup
03/23/2016  10:19 AM            12,533 rollconv.ps
03/23/2016  10:19 AM             2,796 showchar.ps
03/23/2016  10:19 AM                 9 showpage.ps
03/23/2016  10:19 AM             2,281 st640ih.upp
03/23/2016  10:19 AM             1,508 st640ihg.upp
03/23/2016  10:19 AM             1,914 st640p.upp
03/23/2016  10:19 AM             1,141 st640pg.upp
03/23/2016  10:19 AM             1,878 st640pl.upp
03/23/2016  10:19 AM             1,105 st640plg.upp
03/23/2016  10:19 AM             1,923 stc.upp
03/23/2016  10:19 AM             2,154 stc1520h.upp
03/23/2016  10:19 AM             1,904 stc2.upp
03/23/2016  10:19 AM             1,848 stc200_h.upp
03/23/2016  10:19 AM             2,272 stc2s_h.upp
03/23/2016  10:19 AM             1,879 stc2_h.upp
03/23/2016  10:19 AM             2,136 stc300.upp
03/23/2016  10:19 AM             1,341 stc300bl.upp
03/23/2016  10:19 AM             1,430 stc300bm.upp
03/23/2016  10:19 AM             1,903 stc500p.upp
03/23/2016  10:19 AM             1,903 stc500ph.upp
03/23/2016  10:19 AM             2,281 stc600ih.upp
03/23/2016  10:19 AM             1,151 stc600p.upp
03/23/2016  10:19 AM             1,115 stc600pl.upp
03/23/2016  10:19 AM             1,095 stc640p.upp
03/23/2016  10:19 AM             2,158 stc800ih.upp
03/23/2016  10:19 AM             1,115 stc800p.upp
03/23/2016  10:19 AM             1,097 stc800pl.upp
03/23/2016  10:19 AM               673 stcany.upp
03/23/2016  10:19 AM               681 stcany_h.upp
03/23/2016  10:19 AM            25,525 stcinfo.ps
03/23/2016  10:19 AM             5,073 stcolor.ps
03/23/2016  10:19 AM             1,913 stc_h.upp
03/23/2016  10:19 AM               734 stc_l.upp
03/23/2016  10:19 AM             2,502 stocht.ps
03/23/2016  10:19 AM             1,390 traceimg.ps
03/23/2016  10:19 AM             2,586 traceop.ps
03/23/2016  10:19 AM             2,406 type1enc.ps
03/23/2016  10:19 AM             7,462 type1ops.ps
03/23/2016  10:19 AM             5,994 uninfo.ps
03/23/2016  10:19 AM             4,165 unix-lpr.sh
03/23/2016  10:19 AM             1,756 unprot.ps
03/23/2016  10:19 AM             1,991 viewcmyk.ps
03/23/2016  10:19 AM             5,403 viewgif.ps
03/23/2016  10:19 AM             5,693 viewjpeg.ps
03/23/2016  10:19 AM             4,257 viewmiff.ps
03/23/2016  10:19 AM             6,188 viewpbm.ps
03/23/2016  10:19 AM             5,239 viewpcx.ps
03/23/2016  10:19 AM             1,144 viewps2a.ps
03/23/2016  10:19 AM             7,719 viewraw.ps
03/23/2016  10:19 AM             5,630 viewrgb.ps
03/23/2016  10:19 AM               286 wftopfa
03/23/2016  10:19 AM             8,851 wftopfa.ps
03/23/2016  10:19 AM             3,613 winmaps.ps
03/23/2016  10:19 AM               141 wmakebat.bat
03/23/2016  10:19 AM            19,040 wrfont.ps
03/23/2016  10:19 AM             2,325 zeroline.ps
             248 File(s)      1,256,681 bytes
               2 Dir(s)  187,281,731,584 bytes free
Last edited by RobertoG on Mon Apr 18, 2016 11:56 am, edited 1 time in total.
cday
XnThusiast
Posts: 4136
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: check ghostscript working

Post by cday »

RobertoG wrote:i'll try installing XnView this afternoon
XnView Classic, as x32 software, will need GS x32 which might be worth installing in parallel with GS x64 anyway, 'MP will need GS x32 or x64 depending on the version you install...
RobertoG wrote:[Is it] possible to generate a very verbose output, or a debug one, listing the tries of finding GS, end the errors?
I'm not sure...
RobertoG
Posts: 21
Joined: Mon Apr 04, 2016 8:51 am

Re: check ghostscript working

Post by RobertoG »

hi
i found a solution.
I don't know if is the best solution , but worked

i installed XnView
i installed gs 9.19 32 bit
i copied lib e bin from gs into plugin folder under the xnview folder
i configured
XNVIEW_GS_DLL=C:\Program Files (x86)\gs\gs9.19\bin
XNVIEW_GS_LIB=C:\Program Files (x86)\gs\gs9.19\lib
i used nconvert 32 installed with xnview and gs was recognised
So, i finally used 32bit version instead of the original 64bit i was trying with

Thanks for support.
cday
XnThusiast
Posts: 4136
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: check ghostscript working

Post by cday »

RobertoG wrote:hi
i found a solution.
I don't know if is the best solution , but it works
Thanks for reporting back...

But I don't understand why you have been having a problem getting NConvert to find GhostScript:

GhostScript is only available as an installer, and if it is installed and then you call NConvert using the full path to NConvert as you were doing, it should find GS automatically without any further actions being required. NConvert x32 requires GS x32, and NConvert x64 requires GS x64. The test code and test file I posted above should then work immediately.

Possibly the additional actions creating new environment variables you posted originally, which from memory came from a thread concerned with trying to create a portable version of XnView Classic with GS support, upset something in your system? But you haven't been trying to create a portable utility, have you?