[pygtk] "Export to PDF"

Marco Antonio Islas Cruz markuz at islascruz.org
Tue Oct 23 00:56:03 WST 2012


On Oct 22, 2012, at 11:38 AM, Ajay Garg <ajaygargnsit at gmail.com> wrote:

> Two questions ::
> 
> a)
> I came across the link http://svn.majorsilence.com/pygtknotebook/trunk/examples/printing/printing-example.py, and from what I could infer, it uses GTK backend code for printing. I also noticed that the popup-dialog is inevitable.
> 
> Is my notice (the "inevitablity" of the popup-dialog) true?
it is easy to avoid, just use the gtk. PRINT_OPERATION_ACTION_PRINT action on the print opeation,   please take a look a this page[1] is from my blog and even when that page is in spanish the code is pretty easy to read.
> 
> 
> b)
> Also, the cairo/pango you are talking about has a different backend code?
Cairo is the interface you have to use to draw, no matter if you are drawing a new widget, or using a gtk.Drawable or something, it relies on Cairo, before you print you'll have to "draw" your page.
Pango is the interface to handle fonts, and will be required for you if you want to use pretty fonts the easy way.

Note that after the draw, I use PrintOperation to create the printing operation, and the PrintOperation.set_export_filename() to export it to PDF.

[1]http://islascruz.org/html/index.php/blog/show/Imprimir-a-un-archivo-PDF-usando-GTK.html

Cheers

Marco Antonio Islas Cruz
markuz at islascruz.org
marco.islas at gmail.com
<-- linux because I'm free -->



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20121022/d2153664/attachment.html>


More information about the pygtk mailing list