[Gambas-user] Printing from the TextEdit html control

Fabien Bodard gambas.fr at ...626...
Tue Jan 8 09:24:02 CET 2008


Le Monday 07 January 2008 22:32:13 richard terry, vous avez écrit :
> I did peruse the printing examples and read the doc's and tried something
> like that. It sent stuff to the printer, but it was all scrunched almost
> overwriting all the lines.
>
> Tried combinations of stuff like this:
>
> Printer.Setup()
>
>
>      draw.Begin(Printer)
>          rth = draw.RichTextHeight(textedit1.text)
>          rtw = draw.RichTextWidth(textedit1.text)
>    draw.RichText(TextEdit1.text, 0, 0, rth, rtw)
>    '  draw.RichText(TextEdit1.Text, 0, 0, 2000, 2000)
>      draw.end
>
> Outputted the text but virtually all on one line.
>


2000 > page width no ?

You can try that :

Select the gb.report (not finished but...)

Dim hRichText as ReportRichText
Dim hLabel as New ReportLabel(Report)

Report.Size ="A4"
Report.Resolution = Printer.Resolution
Report.Padding = "1.5 cm"
Report.Spacing = "0.3 cm"


hLabel.Text = "My Title"
hLabel.Font = Font["16, Bold"]

hRichText = NewReportRichText(Report)

hRichText.Expand = True
hRichText.Text = "<b>your text</b>"

Draw.Begin(Printer)
	Report.Draw(1)
Draw.End


... not tested

> Maybe someone can give me more explicit example.
>
> Richard
>
> On Mon, 7 Jan 2008 11:14:38 pm you wrote:
> > On lundi 7 janvier 2008, richard terry wrote:
> > > Is this possible?
> > >
> > > Following the printing example from the examples, it only prints the
> > > result of textedit.text (which of course is the raw html code).
> > >
> > > Has anyone succeeded in printing the visual output from this control?
> > >
> > > Thanks
> > >
> > > Richard
> >
> > Use the Draw.RichText*() methods while drawing on the Printer object.
> >
> > Regards,
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplac
>e _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user






More information about the User mailing list