ghostscript

  • Thread starter Chris Jankowski
  • Start date
C

Chris Jankowski

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.
 
B

Brian Elmegaard

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

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

Bengt Richter

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
 
C

Chris Jankowski

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top