Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ghostscript

Reply
Thread Tools

ghostscript

 
 
Chris Jankowski
Guest
Posts: n/a
 
      09-07-2004
Hi all,
I am still fairly new to the Python community and world of Python
programming.

I am having some trouble changing the output directory when I call
Ghostscript.
Any sugguestions would be greatly appreciated. It seems to work fine,
if I put the file in a directory that I am calling it from, like
outputdir = './temp' or I use the "C" drive w/ outputdir = ''. All I
am doing is converting a .pdf to a .tif.

device = 'jpeg'
print pdffile
pdffile = 'c:/Chris_J_Stuff/chris.pdf'
outputdir = "c:\\Chris_J_Stuff\\"
print pdffile
print outputdir
suffix = 'tif'
os.system(ghost_dir + ' -dNOPAUSE -dQUIET -sBATCH -sDEVICE=%s
-sOUTPUTFILE=% s/page%%d.%s %s' % (device, outputdir,suffix,
pdffile))


Thank you in advance.

Chris J.
 
Reply With Quote
 
 
 
 
Brian Elmegaard
Guest
Posts: n/a
 
      09-09-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Chris Jankowski) writes:

> os.system(ghost_dir + ' -dNOPAUSE -dQUIET -sBATCH -sDEVICE=%s
> -sOUTPUTFILE=% s/page%%d.%s %s' % (device, outputdir,suffix,
> pdffile))


What about
os.system('copy '+)
?

--
Brian (remove the sport for mail)
http://www.et.dtu.dk/staff/be
 
Reply With Quote
 
 
 
 
Bengt Richter
Guest
Posts: n/a
 
      09-09-2004
On 7 Sep 2004 11:07:44 -0700, (E-Mail Removed) (Chris Jankowski) wrote:

>Hi all,
>I am still fairly new to the Python community and world of Python
>programming.
>
> I am having some trouble changing the output directory when I call
>Ghostscript.
>Any sugguestions would be greatly appreciated. It seems to work fine,
>if I put the file in a directory that I am calling it from, like
>outputdir = './temp' or I use the "C" drive w/ outputdir = ''. All I
>am doing is converting a .pdf to a .tif.
>
>device = 'jpeg'
>print pdffile
>pdffile = 'c:/Chris_J_Stuff/chris.pdf'
>outputdir = "c:\\Chris_J_Stuff\\"
>print pdffile
>print outputdir
>suffix = 'tif'
>os.system(ghost_dir + ' -dNOPAUSE -dQUIET -sBATCH -sDEVICE=%s
>-sOUTPUTFILE=% s/page%%d.%s %s' % (device, outputdir,suffix,

^^^^--??
>pdffile))
>
>
>Thank you in advance.
>

Suggest replacing 'os.system' with 'print repr' until it looks right.

Regards,
Bengt Richter
 
Reply With Quote
 
Chris Jankowski
Guest
Posts: n/a
 
      09-15-2004
(E-Mail Removed) (Chris Jankowski) wrote in message news:<(E-Mail Removed). com>...
> Hi all,
> I am still fairly new to the Python community and world of Python
> programming.
>
> I am having some trouble changing the output directory when I call
> Ghostscript.
> Any sugguestions would be greatly appreciated. It seems to work fine,
> if I put the file in a directory that I am calling it from, like
> outputdir = './temp' or I use the "C" drive w/ outputdir = ''. All I
> am doing is converting a .pdf to a .tif.
>
> device = 'jpeg'
> print pdffile
> pdffile = 'c:/Chris_J_Stuff/chris.pdf'
> outputdir = "c:\\Chris_J_Stuff\\"
> print pdffile
> print outputdir
> suffix = 'tif'
> os.system(ghost_dir + ' -dNOPAUSE -dQUIET -sBATCH -sDEVICE=%s
> -sOUTPUTFILE=% s/page%%d.%s %s' % (device, outputdir,suffix,
> pdffile))
>
>
> Thank you in advance.
>
> Chris J.


There is a limit on the length of the command line to pass to
Ghostscript. I have not figured out how to get around this yet.

CJ
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ghostscript interface defcon8 Python 2 09-10-2006 10:10 PM
ASP.NET and GhostScript Sjaakie ASP .Net 0 05-10-2006 11:07 AM
Using Ghostscript DLL via ctypes in Py2.3/Win Adam Twardoch Python 1 07-06-2005 12:50 PM
ghostscript leaves windword processes SpamProof ASP .Net 1 02-25-2004 06:48 PM
Ghostscript locking files in ASP.NET Christopher Campbell ASP .Net 1 10-16-2003 05:13 AM



Advertisments