Error in using GS (ghostscript) command in Unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Error in using GS (ghostscript) command in Unix
# 1  
Old 01-18-2010
Error in using GS (ghostscript) command in Unix

We are sometimes facing issues while using the gs command in Unix.
PFB the explanation of the issue

1.Assume we are using the following command to merge few .out files to make a single .pdf file

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile= ABCD.pdf A.out B.out C.out D.out

2.This command ends up in error as follows (which makes no sense to us)

Code:
  ERROR: /rangecheck in --cvrs--
  Operand stack:
     --dict:7/7(L)--   F1   9.0   --dict:6/6(L)--   --dict:6/6(L)--   OUMRXC+Albany WT J   --dict:10/12(ro)(G)--   --nostringval--   --dict:7/7(L)--   --dict:7/7(L)--   1445   --dict:7/7(L)--   --nostringval--   FontMatrix   --nostringval--   FontBBox   --nostringval--   FontName   -2147483647   16   (\000\000\000\000\000\000\000\000)
  Execution stack:
     %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--
  Dictionary stack:
     --dict:1119/1686(ro)(G)--   --dict:0/20(G)--   --dict:107/200(L)--   --dict:107/200(L)--   --dict:104/127(ro)(G)--   --dict:241/347(ro)(G)--   --dict:20/24(L)--   --dict:4/6(L)--   --dict:25/32(L)--   --dict:33/50(ro)(G)--   --dict:24/40(L)--
  Current allocation mode is local
  ESP Ghostscript 815.02: Unrecoverable error, exit code 1

3.Now the file ABCD.pdf has been created with size of few Kbs. It was found that the file ABCD.pdf is a merged output of files A.out and B.out which meant that there is some issue with the file C.out

4.So now we run the command again with C.out removed from the list as follows and it works without any error and we also get the output ABCD.pdf as merged from A.out B.out and D.out

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile= ABCD.pdf A.out B.out D.out

5.On opening the C.out file looks just fine like others but we really don't understand what problem is there with this file causing the command to fail. Even the attributes of the file C.out is same as others.
6.Bottom line is that having the file C.out in the list anywhere causes this error.

Any pointers in this regard will be appreciated.
# 2  
Old 01-18-2010
To make sure the PDF files are good, I'd use pdftk for the merger. If this failed as well, analyzing the input my means of PDFedit or even Adobe Acrobat Professional might help you on ...
# 3  
Old 01-19-2010
^^ But my requirement is to merge the PDF using Unix only :S
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Error executing sqlcmd command through UNIX

Hi All, I am trying to execute a set of sql statements in sql server 2008 using the sqlcmd command in unix and passing the query in the "input" parameter. It is giving me an error "incorrect syntax near 2014". The below statement is giving an error : declare date_val datetime, ... (4 Replies)
Discussion started by: Rahul Raj
4 Replies

2. Shell Programming and Scripting

for loop with internal unix command in statement throwing error

Hi I've gotten a plugin script that won't run. I keeps throwing an error at the following line. for BARCODE_LINE in `cat ${TSP_FILEPATH_BARCODE_TXT} | grep "^barcode"` do #something done The error reads ... (3 Replies)
Discussion started by: jdilts
3 Replies

3. UNIX for Dummies Questions & Answers

Ghostscript error while converting PDF to Postscript

Hi, I have been using Ghostscript to convert PDF to Postscript (PS) file. GS version : 8.15.2. GS command used is : gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite -sOutputFile=output1.ps input1.pdf File format conversion to PS is success in majority of the cases but some PDF files are... (0 Replies)
Discussion started by: geeveejey
0 Replies

4. UNIX for Dummies Questions & Answers

Mailx command in unix shell script, its throwing below error

How to use Mailx command in unix shell script, its throwing below error #!/bin/ksh let x=3 If ; then mailx -s “ $x is greater than 2” example@gmail.com << EOF This is the message body EOF fi its throwing error as syntax error at EOF... (10 Replies)
Discussion started by: only4satish
10 Replies

5. Solaris

Unix restarts error in sar command

Hi Folks, I am again here with a peculier problem. Please see the code root@celdws01: # sar -u -f /var/adm/sa/sa21 SunOS celdws01 5.9 Generic_118558-34 sun4u 12/21/2011 10:10:09 %usr %sys %wio %idle 10:10:09 unix restarts Can anyone help me in... (9 Replies)
Discussion started by: vivek.goel.piet
9 Replies

6. UNIX for Advanced & Expert Users

http error on unix command..

Hi, I am trying to hit an application which is listening on a specific port 2030 and is behind the firewall and get this error. maddy>telnet adrpd011 2030 GET /TestApp and it should give me 200 response, because the application is listening on that port. Instead it gives me this... (5 Replies)
Discussion started by: everurs789
5 Replies

7. UNIX for Dummies Questions & Answers

Ghostscript

I am trying to use Ghostscript oin AIX to print pdf's and it seems I have downloaded it and all dependencys fine - install went fine, when I type any gs commnad except gs -h it just hangs..Here is what it says before the hang: GNU Ghostscript 5.50 (2000-2-13) Copyright (C) 1998 Aladdin... (6 Replies)
Discussion started by: capeme
6 Replies

8. Shell Programming and Scripting

Ambiguous and Command not found Error in UNIX

Hi,All I wrote below script(Example1.sh) and i ran but i got error. it's excuted yesterday. SYSTEM_TIME=`date '+%H:%M:%S'` CMP_LOG_TIME=`head -1 runcmp-HINET.log` CMP_ENDED1=`grep 'HINET CMP ended' runcmp-HINET.log` CMP_ENDED2=`echo "HINET CMP ended"` CMP_FAILED2=`echo "HINET CMP... (2 Replies)
Discussion started by: koti_rama
2 Replies

9. UNIX for Dummies Questions & Answers

Ambiguous and Command not found Error in UNIX

Hi,All I wrote below script(Example1.sh) and i ran but it giveing error. it's excuted yesterday. SYSTEM_TIME=`date '+%H:%M:%S'` CMP_LOG_TIME=`head -1 runcmp-HINET.log` CMP_ENDED1=`grep 'HINET CMP ended' runcmp-HINET.log` CMP_ENDED2=`echo "HINET CMP ended"` CMP_FAILED2=`echo "HINET... (2 Replies)
Discussion started by: koti_rama
2 Replies
Login or Register to Ask a Question