Ghoshscript error : Error: /rangecheck in --.dicttomark-- [closed] - imagemagick

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am trying to use ghoshscript to convert a pdf in image.
The PDF is : http://www.coppernet.zm/MPLS.pdf
$ sudo docsplit images -o /tmp/previews -p 1-5 -s 150,750,1000 -f png MPLS.pdf
While reading gs_cidfm.ps:
Error: /rangecheck in --.dicttomark--
Operand stack:
(gs_cidfm.ps) 1 --nostringval-- 1 Arial --dict:4/4(G)--
Execution stack:
%interp_exit --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:956/1123(G)-- --dict:0/20(G)-- --dict:64/200(L)-- --dict:956/1123(G)-- --dict:8/14(G)-- --dict:1/1(G)--
Current allocation mode is global
Current file position is 4622
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
gs_cidfm.ps 1 --nostringval-- 1 Arial --nostringval--
gm convert: "gs" "-q" "-dBATCH" "-dMaxBitmap=50000000" "-dNOPAUSE" "-sDEVICE=pnmraw" "- dTextAlphaBits=4" "-dGraphicsAlphaBits=4" "-r150x150" "-dFirstPage=1" "-dLastPage=1" " sOutputFile=/tmp/d20121211-1674-zs83qu/gme03xr0" "--" "/tmp/d20121211-1674-zs83qu/gmcjhLqq" "-c" "quit".
gm convert: Postscript delegate failed (MPLS.pdf).
I tryied to apply this : http://thomas-genin.com/ghostscript-convert-error-undefined-in-findresource/ and it creates this error.
EDIT: If I remove the /var/lib/ghostscript/fonts/cidfmap file I don't have the error anymore.
1 /Arial << /FileType /TrueType /Path (/usr/share/fonts/truetype/msttcorefonts/arial.ttf) /SubfontID 0 /CSI [(Artifex) (Unicode) 0] >> ;

You don't say what version of Ghostscript you are using, and because you are using something which executes Ghostscript you haven't given me a command line I can actually try.
However, on the assumption that the (ImageMagick?) command line in the error is the one being used, I rendered your PDF file to PNM without problems using a copy of the current code, so I suspect that this is resolved, I would recommend you upgrade to the current version.
If this doesn't solve the problem, then you should open a bug report at http://bugs.ghostscript.com please attach the PDF file there, and supply a Ghostscript command line which demonstrates the problem.

Related

Imagemagick convert pptx to jpg failing in ghostscript call

Have recently upgrade to imagemagick 7.0.8-14 and have lost the ability to convert a pptx file to a jpg(or any other file format). Was working version before upgrade. The below is the out put from running the convert cmd. Happens on all pptx that have been run against it.
imagemagick version: 7.0.8-14
ghostscript version: 9.07
centos 7
$ convert test.pptx[0] -thumbnail 650x650 -gravity center -extent 1500x1000 s1.jpg
\convert /tmp/magick-17292VzAbA_mfaxJX -> /tmp/magick-17292VzAbA_mfaxJX.pdf using filter : impress_pdf_Export
convert: PDFDelegateFailed `[ghostscript library 9.07] -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dFirstPage=1 -dLastPage=1 '-sOutputFile=/tmp/magick-17292RtJq2Z8iF5iK%d' '-f/tmp/magick-17292wskX7eyNic7t' '-f/tmp/magick-17292jHMWYZOpLjVd'': **** Warning: Dropping incorrect smooth shading object.
**** File did not complete the page properly and may be damaged.
Error: /rangecheck in --run--
Operand stack:
-1 --nostringval--
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1884 1 3 %oparray_pop 1883 1 3 %oparray_pop 1867 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- --nostringval--
Dictionary stack:
--dict:946/1684(ro)(G)-- --dict:1/20(G)-- --dict:82/200(L)-- --dict:82/200(L)-- --dict:109/127(ro)(G)-- --dict:292/300(ro)(G)-- --dict:27/32(L)-- --dict:6/8(L)-- --dict:21/40(L)--
Current allocation mode is local
GPL Ghostscript 9.07: Unrecoverable error, exit code 1
# error/pdf.c/InvokePDFDelegate/276.
convert: no images defined `s1.jpg' # error/convert.c/ConvertImageCommand/3288.
could you share your current version of Ghostscript by running the below command?
rpm -qa ghostscript
In case the version is anything above and including 9.07-31.el7_6.1, could you try to downgrade to 9.07-31 and report if it is fixing your problem? To downgrade to that version, run the below command:
yum downgrade ghostscript-9.07-31.el7
If this was fixing your problem, I would be more than happy if you could share the pptx file with me (if possible).
For more info, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1657694
This problem should be fixed now with a release of ghostscript-9.07-31.el7_6.6.
Kind regards,
-Martin

pdf to JPG conversion using PythonMagick

I am trying to convert pdf file(which is scanned image with extension .pdf) into .jpg which is having multi pages using Python 3.6 with PythonMagick 0.9.13, ghostscript 0.6. All have been installed from PyCharm Interpreter Package.
OS-Windows10 64 bit
It was working fine for some time, but now its giving me an below error, i tried to find fix this by looking into suggestions given in all below links, nothing worked out. Can any one please help me to fix this? it would be great!!
Error with ImageMagick and Ghostscript converting from PDF
Imagemagick Convert PDF to JPEG: FailedToExecuteCommand `"gswin32c.exe" / PDFDelegateFailed
****************************Error Message********************
RuntimeError: Magick: PDFDelegateFailed `[ghostscript library 9.09] -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pamcmyk32" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dUseCIEColor -dFirstPage=1 -dLastPage=1 "-sOutputFile=C:/Users/****/AppData/Local/Temp/magick-13092f9RE6HZSrtFU%d" "-fC:/Users/****/AppData/Local/Temp/magick-13092ks9r_NT8Xygw" "-fC:/Users/****/AppData/Local/Temp/magick-13092NNqfnGb-iNhM"': Unrecoverable error: invalidaccess in put
Operand stack:
true false --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- InputAttributes --nostringval-- --nostringval-- InputAttributes --nostringval--
# error/pdf.c/InvokePDFDelegate/274
Looks like you have an invalid PDF file. You also have an ancient version of Ghostscript, 9.09 is 5 years old and I'd start by trying the current version instead.
I'd also try just opening the PDF file with Ghostscript to see whether that works, if it doesn't then I'd need to have the original PDF file to say why.
One thing that is relevant, though you may not be able to change it, is; Don't use -dUseCIEColor.

In batch scripting what does the expression %* expand? [duplicate]

This question already has answers here:
What does %* mean in a batch file?
(5 answers)
Closed 9 years ago.
I have a batch script which has got a line
echo %* >> test.txt
%PROCESS% %*
What does the expression %* denote and expand to?
It simply expands to the arguments passed in to the shell/batch file. e.g.
foo.bat:
echo %*
and then doing
c:\> foo.bat abcefg hijkl 1 2 3
echo abcefg hijkl 1 2 3
abcefg hijkl 1 2 3
c:\>

vim nerdtree files show up with * appended [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
gVim displays every file with an asterisk on the right (and bold)?
I'm using vim with nerdtree plugin for my rails projects and some of the files show up with a * appended to the filename. They are also a different color from the other files.
edit.html.erb*
index.html.erb
show.html.erb*
What does the * mean?
The key is the executable bit. For example, if you do this:
$touch no_exec_file exec_file
$chmod -v u+x exec_file
$ls -lF
total 0
-rwxr--r-- 1 reoo reoo 0 2012-09-19 19:14 exec_file*
-rw-r--r-- 1 reoo reoo 0 2012-09-19 19:14 no_exec_file
You can see the '*' in the exec_file, now, if you open VIM, you can see the '*' symbol again in the exec_file.
So, the NERDTree plugin shows the '*' symbol for those files that can be execute by the user.
It means that your files are executable, meaning you gave them the permission to be executable. Or they are files like .exe for example.

Use Ghostscript to convert PCL to PostScript

So I want to use Ghostscript to convert files that are created in PCL format to PostScript.
That's the gist of my problem. I am simply trying to run it on the command line, but in the final stage it will have to be run on a lp command like
lp -d < gs something something
GPL Ghostscript 9.00 (2010-09-14)
I will be running this on a Solaris 10 server but I believe any Unix system should work similar.
bash-3.00# /usr/local/bin/gs -sDEVICE=pswrite -dLanguageLevel=1 -dNOPAUSE -dBATCH -dSAFER -sOutputFile=output.ps cms-form.pcl
GPL Ghostscript 9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in &k2G-210z100u0l6d0e63fa0V
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop 1893 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1154/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
Current allocation mode is local
Current file position is 30
GPL Ghostscript 9.00: Unrecoverable error, exit code 1
You are using Ghostscript (gs), which cannot read-in and interprete PCL.
You should use from GhostPDL the component that interpretes PCL: the executable is called pspcl6.
Then a command like
pspcl6 ^
-o out.pdf ^
-sDEVICE=pdfwrite ^
in.pcl
should convert your PCL to PDF. For PostScript Level 2 use -sDEVICE=ps2write.
However, it may be difficult to find pre-compiled binaries of pspcl6. It's not well known, despite it being part of the Ghostscript family of products. You may need to build + compile your own version from the sources.
Update:
http://code.google.com/p/ghostscript/downloads/detail?name=ghostpdl-8.71-win32.zip
http://code.google.com/p/ghostscript/downloads/list

Resources