How to print WebGadget in Linux?

Linux specific forum
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

How to print WebGadget in Linux?

Post by Kukulkan »

Hi,

I'm looking for a way to let the WebGadget print it's content to the current default printer on Linux?

I found webkit-web-frame-print-full() in WebGKitGtk developer documentation, but I don't know how to activate?
http://webkitgtk.org/reference/WebKitWe ... print-full

Any tips?

Kukulkan
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: How to print WebGadget in Linux?

Post by IdeasVacuum »

...something I have done on Windows is to create a printable file by screen-capturing the page of interest.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: How to print WebGadget in Linux?

Post by Kukulkan »

Hello IdeasVacuum,

This, sadly, is not sufficient for me. The Browser-Window is resizable and I can not assume that everybody has the window big enough. At least as I'm displaying user-content that may have a length of several pages...

I currently solved it that way:
1) use body-text to replace "</html>" with "<script>window.print();</script></html>"
2) save the message body again (same filename)
3) force the webgadget to reload using SetGadgetText(webMessageID, "file:///" + strBodyFile.s)

The javascript code is executed on load and starts printing. Uncommon, but it works so far. :)

Best,

Kukulkan
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: How to print WebGadget in Linux?

Post by IdeasVacuum »

...that sounds like a nifty solution to me, sure to be useful to other folk too.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: How to print WebGadget in Linux?

Post by MachineCode »

Do you need to force it to reload? It auto-reloads here for me when I set the new gadget text.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Post Reply