Guest User

Untitled

a guest
Apr 7th, 2016
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1.     # specifically use wktopdf12. Tested with version:
  2.     # wkhtmltopdf 0.12.1-c22928d (with patched qt)
  3.     try:
  4.         if useStylesheet:
  5.             print '\tUsing custom stylesheet for PDF creation.'
  6.             uss = 'file:///venvs/document_processing/python/wkhtmltopdf_cache/report.css'
  7.             subp = Popen(['wkhtmltopdf12', '-q', '--disable-internal-links', '--no-outline',
  8.                           '--user-style-sheet', uss, fullpath, tmppath])
  9.         else:
  10.             subp = Popen(['wkhtmltopdf12', '-q', '--disable-internal-links', '--no-outline', fullpath, tmppath])
  11.         subp.wait()
  12.         fileCreated = True
  13.     except Exception as e:
  14.         print >>sys.stderr, "wkhtmltopdf12 execution failed:", e
  15.         msg = 'Failed to call wkhtmltopdf12. processing: %s' % fullpath
  16.         print >>sys.stderr, ms
Advertisement
Add Comment
Please, Sign In to add comment