Closed sebastien closed 9 years ago
+1
+1
Look here for how to add this method into the Ghost class. https://gist.github.com/jmaupetit/4217925
I modified it just a bit to scale the image.
def capture_pdf(self, filename='ghost.pdf'):
printer = QPrinter(QPrinter.HighResolution)
printer.setResolution(300)
printer.setOutputFileName(filename)
printer.setPaperSize(QPrinter.Letter)
printer.setOrientation(QPrinter.Portrait)
printer.setOutputFormat(QPrinter.PdfFormat)
painter = QPainter(printer)
painter.scale(2, 2)
self.main_frame.render(painter)
painter.end()
http://code.google.com/p/wkhtmltopdf/ allows to convert HTML to PDF using WebKit -- it would be nice to have a similar feature in Ghost.py