Permalink
Browse files

Optimise PDF generated for printing

  • Loading branch information...
simoncadman committed Jun 30, 2013
1 parent b706909 commit a4fcd64c1476a544c662f940cb9f65fd7b9f1a33
Showing with 3 additions and 1 deletion.
  1. +3 −1 backend.py
View
@@ -132,16 +132,18 @@ def getBackendDescription ( ) :
pdfFile = printFile+".pdf"
ps2PdfName = "ps2pdf"
+ convertToPDFParams = [ps2PdfName, "-dPDFSETTINGS=/printer", printFile, pdfFile]
if which(ps2PdfName) == None:
ps2PdfName = "pstopdf"
+ convertToPDFParams = [ps2PdfName, printFile, pdfFile]
submitjobpath = "/usr/lib/cloudprint-cups/" + "submitjob.py"
if not os.path.exists( submitjobpath ):
submitjobpath = "/usr/local/lib/cloudprint-cups/" + "submitjob.py"
if not fileIsPDF( printFile ):
sys.stderr.write( "INFO: Converting print job to PDF\n")
- subprocess.call([ps2PdfName, printFile, pdfFile])
+ subprocess.call(convertToPDFParams)
logfile.write("Running " + submitjobpath + "\n")
logfile.write("Converted to PDF as "+ pdfFile + "\n")
else:

0 comments on commit a4fcd64

Please sign in to comment.