GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Aug 23, 2016 9:05 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Printing with GTK
PostPosted: Mon Apr 09, 2007 10:16 am 

Joined: Tue Mar 27, 2007 6:47 pm
Posts: 2

I've just started to use GTK for windows programming and I'm quite new at programming. But even though I want to know how to print documents.

Is there any special way in GTK to send documents to printer? Can I print what's in a GtkTextBuffer? Or can I make a PostScript file out of it? GtkPrintJob, gtk_print_job_set_source_file() - can I use this function to print PS-files, system wide? What is the easiest way to create a PS-file in C programming? I want to print documents with both images and text.

Does anyone know any tutorial for this? Thanks!

 Post subject:
PostPosted: Mon Apr 09, 2007 11:15 am 
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
To print, you have to create a Cairo context, so basically, you cannot "just print a GtkTextBuffer." You must explicitly format the whole document, page by page. There are no tutorials available right now since printing has just been added to GTK+, but it is covered in my book (

If you would rather just look at code, check out the test application in the GTK+ source, although that contains absolutely no description of what is going on.

Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group