GhostScript - syntax to convert all files in a folder

Hello,

I just downloaded Ghostscript and am trying to figure out how to
convert all of the files in c:\cproofs from PDF to GIF (or JPG if GIF
is not possible).  all I get in resonse to my commands is "Error:
/undefined in GS".  I have about 5000 files I need to convert in that
directoy and dont want to be promted.  I have tried to read through the
docs but I am missing some fundamental port of the process.

Can anyone respond with the correct syntax?

Thanx
Mark

0
byebyemag (6)
11/10/2006 7:13:47 PM
comp.lang.postscript 3460 articles. 0 followers. Post Follow

4 Replies
248 Views

Similar Articles

[PageSpeed] 54
"Koden" <byebyemag@hotmail.com> wrote:

>I just downloaded Ghostscript and am trying to figure out how to
>convert all of the files in c:\cproofs from PDF to GIF (or JPG if GIF
>is not possible).  all I get in resonse to my commands is "Error:
>/undefined in GS".  I have about 5000 files I need to convert in that
>directoy and dont want to be promted.  I have tried to read through the
>docs but I am missing some fundamental port of the process.

GhostScript will do one at a time. Get the syntax right for doing
that, and then write a script/batch file to run it 5000 times.

Above all: gs commands that you see in documentation are DOS commands
for a DOS prompt or script. You do NOT prompt them into GhostScript's
window, this is for typing PostScript commands. You probably don't
want this window, so need to use a different command to run gs.
----------------------------------------
Aandi Inston  quite@dial.pipex.com http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.

0
quite (1321)
11/10/2006 10:58:33 PM
Aandi Inston wrote:
> GhostScript will do one at a time. Get the syntax right for doing
> that, and then write a script/batch file to run it 5000 times.

The time to start up gs is probably pretty significant,
so if it is possible to start gs once and have it do
5000 files, you should win pretty big on total elapsed
time. A script like this ought to work (notice this *is*
ghostscript code, not DOS BAT code). It will not quite
do what you want if the individual pdfs are more than
a single page each; IIRC there is a way to tell
gs to write each page in a separate name.jpgnnn
file, but I'd have to look it up and maybe someone
else remembers how. I'm also just using the defaults
for jpeg resolution, quality, etc. You can specify those
with putdeviceprops too.

Note the doubled backslashes in DOS-style file names.
You might be able to use forward slashes (not doubled);
I don't have a DOS box to try it on.

There isn't a gif device, but are you sure you want
jpeg as the alternative? There are png devices and
gif and png are in the same family of image format;
jpeg is for a different purpose, and won't look very
good unless the pages are really continuous-tone
photographic stuff.

-Chap

% string suffix *ChangeSuffix* newstring
%
% returns a new string the same length as string with the last
% suffix-length bytes replaced with suffix.
% so (foo.pdf) (jpg) ChangeSuffix produces (foo.jpg). Beware this
% assumes the original string ends with a suffix the same length
% as suffix that should be replaced. different behavior could be
% implemented as an exercise.
/ChangeSuffix {
  exch dup length string copy
  dup dup length 3 index length sub 4 -1 roll putinterval
} bind def

(c:\\cproofs\\*.pdf) {
  /PreSave save def
  mark /OutputFile 2 index (jpg) ChangeSuffix
  /jpeg finddevice putdeviceprops setdevice
  run
  PreSave restore
} 128 string filenameforall

0
googrou (113)
11/11/2006 3:07:14 PM
Koden a �crit :
> Hello,
> 
> I just downloaded Ghostscript and am trying to figure out how to
> convert all of the files in c:\cproofs from PDF to GIF (or JPG if GIF
> is not possible).  all I get in resonse to my commands is "Error:
> /undefined in GS".  I have about 5000 files I need to convert in that
> directoy and dont want to be promted.  I have tried to read through the
> docs but I am missing some fundamental port of the process.
> 
> Can anyone respond with the correct syntax?
> 
> Thanx
> Mark
> 
Apparently, you use Windows (c:\proofs).
You can download PDFCreator. It uses Ghostscript as engine and has an
interface to prepare batch processing of different files.
It can help to solve the problem.
Otherwise, a script in python can read files in a directory and process
them with ghosyscript. This second solution can be used on any system.

Regards.

Alain
0
arwebmail (75)
11/13/2006 8:23:02 AM
"Koden" <byebyemag@hotmail.com> wrote in message 
news:1163186027.750789.193520@k70g2000cwa.googlegroups.com...
> I just downloaded Ghostscript and am trying to figure out how to
> convert all of the files in c:\cproofs from PDF to GIF (or JPG if GIF
> is not possible).  all I get in resonse to my commands is "Error:
> /undefined in GS".  I have about 5000 files I need to convert in that
> directoy and dont want to be promted.  I have tried to read through the
> docs but I am missing some fundamental port of the process.
>
> Can anyone respond with the correct syntax?

From a Windows command prompt, try the following
  for %i in (*.ps) do echo %i

Modify as appropriate to call ghostscript instead of "echo %i"


0
11/18/2006 10:42:34 AM
Reply:
Similar Artilces:

Re: journal files
i have this errors: out of curiousity i made the /etc/namedb/master folder writable by "bind" user. but then, it just changed to "root" then this happens.. 19-Apr-2005 17:07:28.171 general: error: dumping master file: master/tmp-F7LfjMaJTF: open: permission denied 19-Apr-2005 17:22:12.185 general: error: dumping master file: master/tmp-ptHtPppE29: open: permission denied 19-Apr-2005 17:34:27.196 general: error: dumping master file: master/tmp-Rg2r6kQTfk: open: permission denied 19-Apr-2005 17:48:03.209 general: error: dumping master file: master/tmp-pl40...

redirecting stdout to a file as well as screen
How could i make, from inside the program, to have the stdout and stderr to be printed both to a file as well the terminal(as usual). On Apr 12, 8:14 am, "SamG" <mad.vi...@gmail.com> wrote: > How could i make, from inside the program, to have the stdout and > stderr to be printed both to a file as well the terminal(as usual). One way would be to create a custom class which has the same methods as the file type, and held a list of file-like objects to write to. e.g. class multicaster(object): def __init__(self, filelist): self.filelist = filelist def w...

Moving the users folder
Short and simple: Is it possible to move the "Users" folder in Mac OS X 10.2.6 onto a different partition? In article <3f5871ce$0$12638$afc38c87@news.easynet.co.uk>, "David Glover" <usenet@davidglover.org> wrote: > Is it possible to move the "Users" folder in Mac OS X 10.2.6 onto a > different partition? Yes: 1) create your new Users location 2) rename your old Users location to something else 3) create an alias to the new location, named Users, as /Users 4) reboot 5) If you can see your home files when you log in, you're golden. -- ...

Algorithm to Convert WPF ellipse from different definition
I am given an Ellipse in the following definition: <Path Name="_Display2_Ellipse2" Height="50" Width="60" Stroke="black" StrokeThickness="1" Fill="teal" Visibility="Visible"> <Path.Data> <EllipseGeometry Center="0,0" RadiusX="1" RadiusY="1"> <EllipseGeometry.Transform> <MatrixTransform> <MatrixTransform.Matrix> <Matrix M11="76.5" M12="0" M21="0" M22="-27" OffsetX="...

OS9: Parent Folder Characteristics
I had previously been using OS9.2, and whenever a new folder was created - either manually or by another program - the new folder automatically had the same characteristics as the parent folder. I upgraded to OS9.2.2 a few weeks ago, and now ONLY manually-created folders have the same characteristics as the parent folder. Is there any way to force OS9.2.2 to automatically grant parent-folder characteristics to ALL newly-created folders, whether created manually or by another program (such as Stuffit Expander)? ===================================== Wolf Feather FEATHER7@I...

Convert 简体中文 in Chinese to &#31616;&#20307;&#20013;&#25991;&
简体中文 converts to &#31616;&#20307;&#20013;&#25991;&#10; using this utility: http://people.w3.org/rishida/scripts/uniview/conversion.php Is there a way that I can get Ruby to do this for me? Thanks! Philip -- Posted via http://www.ruby-forum.com/. On Dec 11, 10:39 am, Philip Brocoum <philip.broc...@gmail.com> wrote: > =BC=F2=CC=E5=D6=D0=CE=C4 > > converts to > > &#31616;&#20307;&#20013;&#25991;&#10; > > using this utility:http://people.w3.org/rishida/scripts/uniview/conversion= php > > Is there a way that I can g...

convert 8 byte real to double
Hello, does anybody know if is there any function library in C that could help me to convert a 8 byte real floating point representation into a C double format? 8-byte real: SEEEEEEE MMMMMMMM MMMMMMMM MMMMMMMM .... MMMMMMMM S = sign E = exponent M = mantissa Thank you, regards, Camelot scosmo@tiscalinet.it wrote: > Hello, > does anybody know if is there any function library in C that could > help me to convert a 8 byte real floating point representation into a > C double format? > > 8-byte real: > > SEEEEEEE MMMMMMMM MMMMMMMM MMMMMMMM .... MMMMMMMM > > S...

Converting S/36 to AS/400
I'm a vetern S/36 with virtually no AS/400 experience and am faced with a conversion of a manufacturing system to native mode in the next month. Has anyone else had this experience and can tell me what kind of living hell I'm in for? Thanks. -John Coryat http://www.coryat.com Hi John, Few questions 1. What&#8217;s your time frame tor complete the installation 1-2 years 2. What is the size of your company 3. How big is the AS/400 or Iseries 4. How much training or experience do you have on the AS/400. More education is needed than experience. A computer is a computer. I kn...

Re: Unix SAS: How to save log file while in SAS session?
> From: Duck-Hye Yang > I am using SAS Unix Display manager. > I put together single small sas programming files in one > giant sas programming file. I need to save log and output > files AFTER each single small programming file. The problem > is that I do not know how to save log and output while in SAS session. > > Below is the outline of what I'd like to do: examine PROC PrintTo Note this requires you to allocate a global macro variable %Let Path_Lst = c:\ProjectA\lst; which I do in my project autoexec This is the folder that the log and list will be written to...

PDF encryption Ghostscript 8.51
Dear all, I was trying to transform a PS document to PDF using Ghostscript 8.51. The ps document is generated in latex, and in my editor the parameters to generate the PDF are the following: gswin32c.exe -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile="%bm.pdf" -c save pop -f "%bm.ps" Where %bm is the file name... Checking the documentation on http://casper.ghostscript.com/~ghostgum/pdftips.htm#encrypt I found out that I should have changed to: gswin32c.exe -dEncryptionR#3 -dPermissions#-3904 -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdf...

Converting tiff file to pdf
Do you know a way to convert multipages tiff file to pdf. I use FabTwain library to scan documents to tiff files, but I would like to produce pdf files. Regards, Jacek Dear Jacek: On Friday, November 16, 2012 3:41:39 AM UTC-7, jacek...@gmail.com wrote: > Do you know a way to convert multipages tiff file > to pdf. I use FabTwain library to scan documents > to tiff files, but I would like to produce pdf > files. One way would be to use something like the CutePDF printer driver, and print the TIFF to it. David A. Smith >One way would be to use something like th...

I have problems with creating the classic game Wumpus. the file: http://esnips.c
Im trying to create a version of the game Wumpus. Mine is called Belzebub. But im STUCK! And its due tuesday 2 maj. Im panicing! Can some one help me?? here is the file: http://esnips.com/webfolder/b71bfe95-d363-4dd3-bfad-39999a9e36d0 What i have the biggest problems with now is between line 8 and 23. How i can move the character trough the game. Other parts of the game that have with the movement to do is between line 83-114 and 123-143. This is part of the spec: "The player walks around in the hallways, finds and tries to kill Wumpus (Belzebub). The game finishes when the player ...

Split DB application and file sizes
I am working on a database in ACCESS 2003. This is a simple DB with only one table. I have split the DB so I can upgrade and debug the front end before installing on my clients' computer. I used the ACCESS splitter utility and everything appeared to go OK. If I run "Copy of DB_be.mdb" I see only the table, not the Queries or Forms. When I run the front end "Copy of DB.mdb" I see the Queries and Forms. but, I also see the Table. If I delete the table from the front end and try to run a Query I receive the error message that the application can not find the table...

TK options file
Can anyone get these to work properly? I have these in my 'startup' options file: *Top.Button.foreground: yellow *Top.Button.background: red *Top.Button.width: 10 *Top.Button.height: 5 The width and height are used, but the foreground and background are not. As far as I can see they are not overridden by widgetDefault. Any suggestions? alex.e.c@gmail.com wrote: > I have these in my 'startup' options file: > > *Top.Button.foreground: yellow > *Top.Button.background: red > *Top.Button.width: 10 > *Top.Button.height: 5 > > The width and height are u...

Convert photo of person to older/younger age
Plugin/add-on question: Is there a software application I can use with PSP to make a photo of a person younger/older. E.g. I could choose say 15 years younger/older and it would approximate the image as it might have been/will be. Would like to play around with photos of family and friends to see what they looked like/will possible look like. I think you watch too much TV, ��! But you could try the warp tool in PSP 8, maybe together with the smudge or push tools. For more serious purposes, try Viagra (see your spam) ;-) Kiri "��" <news@kidsnews.au.org> schreef in berich...

Previous Systems folder
About four months ago Apple support had me do an archive and reinstall to try to resolve a problem, which turned out to be a hardware problem anyway. I noticed losing a few gigs of disk space and assumed that was the "archive". I'm now running our of disk space and looking for stuff to delete and see I have a "Previous Systems" folder that's almost 3 gigs in size. Is it safe to delete it? In article <nina_taborin-01850A.21281420072004@news.telus.net>, Nina Taborin <nina_taborin@yahoo.ca> wrote: > About four months ago Apple support had me do a...

Access Report to multiple PDF files
Hello- I need to create multiple PDF files from one access report that breaks on client for approx. 20 clients. Any suggestions? Thanks! You will need to understand how to work with recordsets in VBA to achieve this. OpenRecordset() on a SQL statement that gives you one client per record. Loop until EOF, using an OpenReport to fire the report off to Distiller or whatever you use to create the PDF, using a WhereCondition so that the report contains the info that relates to the client in the loop. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - ht...

Ghostscript error
When I read a document into Ghostscript, I get the following Operand stack: --dict:9/9(L)-- F1 1 --dict:8/8(L)-- --dict:8/8(L)-- Myriad-Bold --dict:11/11(L)-- Helvetica-Bold Helvetica-Bold Font Helvetica-Bold 734245 Helvetica-Bold --nostringval-- Helvetica-Bold Courier Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 -...

Problem with clarionet send files
Hello, I'm using clarion 6.3 with clarionet 6.3 but when I download data from server to client site receive the followings error. Clarion Decompresion Error header sum error in function name getsenddatatobuffer lsd_decompress and following send this error. UNABLE TO OPEN "MDI" WINDOW NO APPLICATION ACTIVE DO YOU WANT TO GPF? when check this in the help file not find a solution what is wrong! or the problem to receive this error. or need send this to sofvelocity Thanks and excuse my english... ...

ghostscript: Converting only a page of a PDF
Hi, I just downloaded ghostscript 8.54 for my Fedora Core 6 Linux system. Is there a way from the command line to convert only a single page of a PDF file to a JPEG? What I'm ideally after is, if I have a 5 page PDF, to have 5 JPG files, one for each page of the PDF. Thanks for any advice in this arena, - Dave "laredotornado" <laredotornado@zipmail.com> wrote in message news:<ba1a6020-8e51-406b-8035-4fe5acaaeb22@h11g2000prf.googlegroups.com>... > Hi, > > I just downloaded ghostscript 8.54 for my Fedora Core 6 Linux system. > Is there a way from the com...

How do you run a class file from windows?
When .java file is compiled, a .class file is produced, which can be run by using the java command in the DOS Prompt. I would like to know how it can be run directly from Windows(e.g. by double clicking as in an .exe file). On 18 Sep 2004 01:28:15 -0700, Sambit Mukherjee wrote: > I would like to know how it can be run directly from Windows(e.g. by > double clicking as in an .exe file). <http://www.physci.org/codes/javafaq.jsp#jar> HTH -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ ...

asking how to load and process *.jpg file #2
I need a help,i want to process a *.jpg file in a facerecognition using eigenface algorithm, the source is from a webcam, then the picture is captured and saved as *.jpg file in folder work in matlab. but I have the difficultiest to upload the image and process the image. can any body help me thyeadi tungson wrote: > > > I need a help,i want to process a *.jpg file in a facerecognition > using eigenface algorithm, the source is from a webcam, then the > picture is captured and saved as *.jpg file in folder work in > matlab. > but I have the difficultiest to upload the ima...

Convert Microsoft Word Document to pdf?
My Word documents include tables, symbol fonts, and drawing objects, mostly lines and arrows. Can this be done? Any info would be most appreciated. Thanks, Fred. http://www.clicktoconvert.com/index.html he he, thanks anyways "FredH" <fwh@abc.xyz> wrote in message news:MdL2c.2386$j05.44899@news20.bellglobal.com... > My Word documents include tables, symbol fonts, and drawing objects, mostly > lines and arrows. > > Can this be done? Any info would be most appreciated. > > Thanks, > Fred. > > ...

Buck Converter
Hi, I am new to matlab and would wish to simulate a Buck Converter. I did try it however the output is not within the range when simulated. Its amazing though. Not sure what's the problem?. Do anyone in our group have exposure to simulating Buck converter?. I could send the file for review. Thanks and regards ...

plz sir send me code to convert a .PDF file to .docx in java
plzzzzz............ On 6/13/2013 10:42 AM, krishna.taniya@gmail.com wrote: > plzzzzz............ http://www.lmgtfy.com/?q=%22pdf+to+docx%22+java -- Eric Sosman esosman@comcast-dot-net.invalid Eric Sosman wrote: > krishna.taniya@gmail.com wrote: >> plzzzzz............ That is not a word. Also, it is good practice to state your problem in detail within the body of the post. Simply putting things in a title leads to error and confusion, as we have seen in this newsgroup many times. > http://www.lmgtfy.com/?q=%22pdf+to+docx%22+java Eric is doing you a fa...