[Gambas-user] TextEdit - how to print?

ron ronstk at ...239...
Wed Sep 5 14:49:22 CEST 2007


On Wednesday 05 September 2007 13:53, Benoit Minisini wrote:
> On mercredi 05 septembre 2007, Fredrik Hansson wrote:
> > The TextEdit control (in gb.qt) produces an HTML code which is sent to
> > the printer in its whole if I use for example
> > Draw.Text(TextEdit1.Text,x,y). Do I have to make an interpreter myself
> > to make only the text (and not the HTML tags) to be printed?
> >
> > /Fredrik
> >
> 
> At the moment, yes.
> 
> But I plan to make some sort of Draw.HTML() for that, which will be able to 
> render a small part of HTML markups.
> 
> Regards,
> 

Maybe a temporary solution could be to use the webbrowser control as middle man.

Get the TextEdit1.Text into the web control as text
Use the webcontrol.Grab() function to get a image/picture of it and put that
into the draw area.

Take care the webcontrol must be fully visible without overlay-ed by other 
controls/windows or partial of screen.
The grab takes the full content of the control and if off screen it takes 
simple what is left in your memory to match size of the control. (security issue)

I did use this method once using a form as delivery note for layout.
The lower half was of screen and I could see on the print old images from
a page visit with Konqueror/Firefox :)

Ron




More information about the User mailing list