printing - What is the best way to print a Gtk.Widget to the printer? -


i have couple of (mostly) text widgets render printer through standard "print..." menu option. 1 widget mono.texteditor document, , other gtk.textview.

i'm looking pretty basic print now, might wrap long lines, , add page numbers. need code of myself somehow?

if have pointers, great, if in c#.

for line wrap , justification, 1 can use pango layout options, described python @ pygtk/class-pangolayout or c @ pango/pango-layout-objects. see functions pango_layout_set_wrap() , pango_layout_set_justify().

also see example-code routines begin_print, do_page_setup, , do_print in file pygtk-demo/demos/print_editor.py, if have installed pygtk on system. (on system, full path directory of python gtk demo files /usr/share/doc/pygtk2-2.17.0/examples/pygtk-demo/demos)

for printer setup dialog, see gtk-high-level-printing-api c, or class-gtkprintoperation python.

update 1: posted answer above new user rep. 1, , had disable 2 links because of following message: "oops! answer couldn't submitted because: we're sorry, spam prevention mechanism, new users can post maximum of 2 hyperlinks. earn more 10 reputation post more hyperlinks." in update fixed links.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -