automated printing from konqurer

Nicholas Grabowski ng at ngsoft.org
Sun Feb 2 20:14:54 GMT 2003


Developers

I am trying to automate a print job from konqueror.  Basically, what I
want to do is:
1.) Communicate to conqueror from another program.
2.) Open a url with konqueror.
3.) Print that url to a file or printer.

Note: there should be no user interaction to the printing or konqueror,
i.e. I would like to either extend konqueror and add some functionality
that allows me to print to the default printer.  Then I would like to
embed it in my app, or instantiate a konqueror instance and call the new
api that will allow me to print the url I open.  

To this point I've looked at two options:
1.) Use the DCOP interface. I was only able to get as far as popping up
the printer interface.  Beyond that I was not able to pragmatically
finish the process.  I.E. force the print dialog to print.  It does not
seem that it will be possible to do what I want via the DCOP
action(print) command. However, I'm open to suggestions if you feel this
is the best way to proceed.
2.)  I looked into kdeprint and realized that really all I need to do is
create a KPrinter object call autoconfigure() on that object and then
call the paint() methods on KPrinter (as it extends QWidget).  However,
I'm not sure where or how Konqueror paints itself.  Can you help me in
finding and harnessing this code.  I'm assuming there is a method or set
of methods somewhere in Konqueror/kdecore that paint to the main frame. 
If I could find this code I could probably add another method (that
paints to the KPrinter in mush the same way as things are painted to the
main frame) to the Konqueror application and then access the
functionality via DCOP.  What do you think?

Is there some option you know of I haven't considered?

Thanks in advance.
By the way KDE is a great product.  I really enjoy it.  Kongrats on
landing Konqueror on the MAC.

Nick
 

-- 
Nicholas Grabowski <ng at ngsoft.org>




More information about the kfm-devel mailing list