[Gambas-user] Printing from the TextEdit html control

richard terry rterry at ...1822...
Wed Jan 9 03:57:04 CET 2008


Ok, This code (which I hope I've typed in your additions properly, gives only 
the same output as my original code (iedraw.RichText(TextEdit1.text, 0, 0, 
rth, rtw) - scrunched up unspaced output just fitting into 1cm at top of page

      DIM myreport AS NEW Report
      'DIM hRichText AS ReportRichText
      DIM hRichText AS ReportTextLabel
      Printer.Setup()
    
      myreport.Size = "A4"
      myreport.Resolution = Printer.Resolution
      myreport.Padding = "1.5 cm"
      myreport.Spacing = "0.3 cm"
      
      hRichText = NEW ReportTextLabel(myreport)
      hRichText.Expand = TRUE
      hRichText.Text = TextEdit1.text
      Draw.Begin(Printer)
              myreport.Draw(1)
      Draw.End

Did you test a simple example, does it work on your system? I'm keen to get 
this working as if I can most other obstacles to me starting a project will 
have been covered I think.

Richard.

Wed, 9 Jan 2008 10:12:10 am you wrote:
> Le Tuesday 08 January 2008 23:01:15 richard terry, vous avez écrit :
> > Thanks for your reply, but I am cretinously stupid with concepts. My mind
> > needs something absolutely concrete and simple to be able to grasp it.
> >
> > My first attempt is as follows (dosn't work), it baulks at the line
> > containing ReportRichTExt as 'unkown identifier' I've made sure I include
> > gb.report in the project properties. My html is in TextEdit1.
>
> Don't forget that gb.report is really an early alpha component
>
> > ========================================
> >       DIM myreport AS NEW Report
>
>       DIM hRichText AS ReportTextLabel
>
> >  
> >       Printer.Setup()
> >    
> >       myreport.Size = "A4"
> >       myreport.Resolution = Printer.Resolution
> >       myreport.Padding = "1.5 cm"
> >       myreport.Spacing = "0.3 cm"
>
> 	hRichText = New ReportTextLabel(myReport)
>        hRichText.Expand = TRUE
>
> >       hRichText.Text = TextEdit1.text
> >       Draw.Begin(Printer)
> >               myreport.Draw(1)
> >       Draw.End
> >
> >
> > Regards, and thanks for your patience with my stupidity!
> >
> > Richard
> >
> > On Tue, 8 Jan 2008 07:24:02 pm Fabien Bodard wrote:
> > > 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/mark
> > > >et pl ac e _______________________________________________
> > > > Gambas-user mailing list
> > > > Gambas-user at lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> > > -----------------------------------------------------------------------
> > >-- 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/market
> > >pl ac e _______________________________________________
> > > Gambas-user mailing list
> > > Gambas-user at lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> > -------------------------------------------------------------------------
> > 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/marketpl
> >ac 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