Skip to content

Commit

Permalink
Merge pull request #246 from socrateslee/print-without-full-page
Browse files Browse the repository at this point in the history
Print with full page mode only when margin is not (0, 0, 0, 0)
  • Loading branch information
jeanphix committed Jul 30, 2015
2 parents 7fc7c68 + 7a6761f commit fb6afb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ghost/ghost.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ def print_to_pdf(
printer.setOutputFormat(QPrinter.PdfFormat)
printer.setPaperSize(QtCore.QSizeF(*paper_size), paper_units)
printer.setPageMargins(*(paper_margins + (paper_units,)))
printer.setFullPage(True)
if paper_margins != (0, 0, 0, 0):
printer.setFullPage(True)
printer.setOutputFileName(path)
if self.webview is None:
self.webview = QtWebKit.QWebView()
Expand Down

0 comments on commit fb6afb6

Please sign in to comment.