473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

ghostscript

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.
Jul 18 '05 #1
3 2645
cj********@hbr-inc.com (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
Jul 18 '05 #2
On 7 Sep 2004 11:07:44 -0700, cj********@hbr-inc.com (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
Jul 18 '05 #3
cj********@hbr-inc.com (Chris Jankowski) wrote in message news:<a1**************************@posting.google. 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
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Adam Twardoch | last post by:
I've written a simple commanline wrapper for calling GhostScript from Python. It uses os.system under Windows and os.popen under unixes. The call looks basically like this: gs -q -dNODISPLAY...
1
by: tc | last post by:
Does GhostScript provide any library so that we can reference it in our C# project to programmatically handle printing of ps / pdf files? I have tried to use the gs command (call by process) in...
0
by: Roel | last post by:
Hello I try to pint a pdf from a .net webapplication. Therefore I use GhostScript. When I execute the following line via "start - run", the pdf is printed correctly:...
1
by: Christopher Campbell | last post by:
I am calling Ghostscript 8.00 from and ASP.NET application (VB) to create ..JPG thumbnails of .PDF files. I have created a class module for Ghostscript and I am creating an instance of the class...
2
by: SpamProof | last post by:
I'm using the ps2pdf.bat file that ghostscript provides through my vb.net code to convert word documents to pdf. After each conversion, a winword process is left runnning in the task manager. ...
4
by: Sjaakie | last post by:
Hello, Can someone tell me if it is possible to use Ghostscript from C#? I would like to create thumbnails from several PDFs. TIA
0
by: Sjaakie | last post by:
Is there a Ghostscript ASP.NET wrapper available? Preferrably with an example... Thanks
2
by: defcon8 | last post by:
Does a ghostscript interface for python exist? I have searched google quite a bit and all I have been able to find are command line hacks from within python. Thanks in advance for any useful help.
18
Ciary
by: Ciary | last post by:
hi all, it's my second question of today but since i'm stuck with this problem, i'm going to ask it anyway. i'm trying to convert an uploaded pdf file to a jpg, gif or png file. i want to use it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.