1
#Copyright ReportLab Europe Ltd. 2000-2004
2
#see license.txt for license details
3
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/tools/py2pdf/idle_print.py
5
# idle_print [py2pdf_options] filename
6
__version__=''' $Id$ '''
7
# you should adjust the globals below to configure for your system
9
import sys, os, py2pdf, string, time
10
#whether we remove input/output files; if you get trouble on windows try setting _out to 0
15
#how to call up your acrobat reader
16
if sys.platform=='win32':
17
acrord = 'C:\\Program Files\\Adobe\\Acrobat 4.0\\Reader\\AcroRd32.exe'
18
def printpdf(pdfname):
19
args = [acrord, pdfname]
20
os.spawnv(os.P_WAIT, args[0], args)
23
def printpdf(pdfname):
25
cmd = "%s %s" % (acrord,pdfname)
27
cmd = "%s -toPostScript < %s | lpr" % (acrord,pdfname)
30
args = ['--input=python']
32
for f in sys.argv[1:]:
35
if opt =='no_auto_rm_in':
37
elif opt =='auto_rm_in':
39
elif opt =='no_auto_rm_out':
41
elif opt =='auto_rm_out':
43
elif opt =='viewonly':
45
elif opt[:9] =='acroread=':
53
if auto_rm_in: os.remove(f)
54
pdfname = os.path.splitext(f)[0]+'.pdf'
56
if auto_rm_out: os.remove(pdfname)
b'\\ No newline at end of file'