|
|
 |
 |
 |
 |
TCL(Tool Command Language) Scripting
|
 |
 |
 |
 |
 |
 |
 |
 |
TkHTML3 and printing?
Hello I'm currently implementing a help-browser using TkHTML3. One feature should be to print the current help-page. I can't figure out, if it's possible to export the rendered contents of hv3 (the megawidget for rendering HTML in TkHTML3). Is it possible to export the rendered contents to Postscript or to something else like it can be done in Canvas? If not, does anybody know of a Tcl/Tk-only way of exporting a HTML-Document to Postscript or something else? TIA, regards Stephan
Hello Stephan, I use still TkHTML2, but perhabs the way to go is similar. 1. I extract the text contents from the TkHTML2 widget 2. I push the text contents into a temporary text widget 3. I use the binary tkPrint extension on MS Windows to print the text widget contents using the command "Print" 4. I destroy the text widget The tkPrint extension is able to print a canvas, but I don't know if the new TkHTML3 provides a kind of canvas creation from its contents, or if it is able to emulate a canvas widget. Best regards, Martin On Jun 5, 8:14 am, skuha@web.de wrote:
> Hello > I'm currently implementing a help-browser using TkHTML3. One feature > should be to print the current help-page. I can't figure out, if it's > possible to export the rendered contents of hv3 (the megawidget for > rendering HTML in TkHTML3). Is it possible to export the rendered > contents to Postscript or to something else like it can be done in > Canvas? If not, does anybody know of a Tcl/Tk-only way of exporting a > HTML-Document to Postscript or something else? > TIA, regards > Stephan
Hello Thanks for the hints, but: > 1. I extract the text contents from the TkHTML2 widget
I can do this, but I need the full document, including images and formatting, not just plain text. > 2. I push the text contents into a temporary text widget > 3. I use the binary tkPrint extension on MS Windows to print the text > widget contents using the command "Print"
I'm on Linux... > 4. I destroy the text widget > The tkPrint extension is able to print a canvas, but I don't know if > the new TkHTML3 provides a kind of canvas creation from its contents, > or if it is able to emulate a canvas widget.
That's what I was hoping for... But the documentation of TkHTML3 is not very usefull and its not in sync with the source, I think - or maybe I simply do not understand it... Regards Stephan
Hello, > Canvas? If not, does anybody know of a Tcl/Tk-only way of exporting a > HTML-Document to Postscript or something else?
Only "something else".... You have three options: 1) Printing? What's this? Let the user configure a program that can print html. 2) Do the above job for the user. Use html2ps on Unix or 'rundll32.exe mshtml.dll,PrintHTML "%1"' on Windows. 3) Implement a -postscript option for the widgets you have to render the contents on your own. This leads to a reimplementation of html2ps in Tcl. Cheers, Gran -- string map { DOT . AT @ } goeranDOThankeATgmxDOTde
|
 |
 |
 |
 |
|