Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

print file in python

GHOSTSCRIPT_PATH = "C:path	oGHOSTSCRIPTingswin32.exe"
GSPRINT_PATH = "C:path	oGSPRINTgsprint.exe"

# YOU CAN PUT HERE THE NAME OF YOUR SPECIFIC PRINTER INSTEAD OF DEFAULT
currentprinter = win32print.GetDefaultPrinter()

win32api.ShellExecute(0, 'open', GSPRINT_PATH, '-ghostscript "'+GHOSTSCRIPT_PATH+'" -printer "'+currentprinter+'" "PDFFile.pdf"', '.', 0)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #print #file #python
ADD COMMENT
Topic
Name
8+5 =