Re: How to pass file to gnome_print?

Jürg Billeter <[email protected]> Thu, 17 Mar 2005 10:09:32 +0100
Newsgroups gmane.comp.gnome.print
Message-ID <[email protected]>
On Don, 2005-03-17 at 14:17 +0530, Mohit Kumar wrote:
> So does this mean, that an application cannot use gnome print dialog
> to print the contents of its files?
> Say I am writing a text editor and I use my special file format but I
> can convert into PS and then send it using gnome print dialog to the
> printer?
> Do I need to create my own print dialog in this case?
> Moreover then what is the scenario for usage of gnome print dialog....
> 
> I am sorry if I am missing something, but its not clear to me......
> Also there is this function:
> #ifdef GNOME_PRINT_UNSTABLE_API
> void     gnome_print_job_set_file (GnomePrintJob *job, gchar *input);
> #endif
> which used to let me set the file to print FROM.

It's possible to print postscript files using libgnomeprint(ui) with
gnome_print_job_set_file but AFAIK there are some caveats like no print
preview. You can't directly print PDF files using that function but
poppler/xpdf is able to convert pdf to postscript.

You may want to look at the sources of evince or gpdf as they use the
aforementioned function to print. 

HTH,

Jürg
-- 
Jürg Billeter <[email protected]>