Print text file

How I can open text file in xojo and print all content?
Plain text, no rtf.

Sure. Check examples for TextArea, the control to do it.
And StyledTextPrinter class for printing.

Xojo probably comes with a little text editor example which does it already.

I found this, but print just first page:

Dim stp As StyledTextPrinter
Dim g As Graphics
g = OpenPrinterDialog
If g <> Nil Then
    // 72 pixels per inch * 7.5 inches
    Dim textWidth As Integer = 72 * 7.5
    stp = TextArea1.StyledTextPrinter(g, textWidth)
    stp.DrawBlock(0, 0, 72*10)
End If

Go here
http://documentation.xojo.com/index.php/StyledTextPrinter.EOF

here is an untested off the top of my head, without line wrapping example

Dim g As Graphics
dim y as integer
dim lines() as string
lines=split(replaceendofline(textarea1.text,endofline.unix),endofline.unix)
g = OpenPrinterDialog
If g <> Nil Then
   for i=0 to lines.ubound
g.drawstring lines(i),0,y)
y=y+g.textheight
if y>g.height then g.nextpage
next i

End If

[quote=307457:@Christian Schmitz][/quote]
too many times, people cut and paste and complain “that doesn’t work”… “not exactly what I wanted” wahhhhhh