title: Generating PDF using QPrinter (Qt, PySide), content unintentionally printed by physical printer
body: <p>I have a desktop application written in Python which use Qt (PySide) for its GUI.</p>
  
  <p>A feature of my application is displaying reports to the user, by supplying the report content (generated in HTML) to a <a href="http://doc.qt.io/qt-5/qwebview.html" rel="nofollow">QWebView</a>.</p>
  
  <p>This reporting feature also allows the user to export the report to a pdf. To achieve this, I have used the <a href="http://qt-project.org/doc/qt-4.8/qprinter.html" rel="nofollow">QPrinter</a> class.
  Here is an example:</p>
  
  <pre><code>printer = QPrinter()
  printer.setOutputFileName('test.pdf')
  printer.setOutputFormat(QPrinter.PdfFormat)
  printer.setPageSize(QPrinter.A4)
  printer.setOrientation(QPrinter::Landscape)        
  printer.setFullPage(True)
  
  self.webview.print_(printer)
  </code></pre>
  
  <p>The PDF output is fine. However sometimes the content is also printed to a physical printer if there is one present, which is not intended.</p>
  
  <p>I have looked through the documentation and can't find a solution to this. Please help.</p>