Printing textarea

I’m trying to print a textarea with the followin code:
Var ps As New PrinterSetup
If ps.ShowPageSetupDialog Then
Var g As Graphics
g = PrinterSetup.OpenPrinter(ps)
If g <> Nil Then
// Draw text 1 inch across and 1 inch down
g.DrawText(textarea,text, ps.HorizontalResolution, ps.VerticalResolution)
End If
End If

but it only prints one line.

StyledTextPrinter doesn’t work with linux

I found the solution:
Dim g as Graphics
Dim p as PrinterSetup
p=New PrinterSetup
If p.PageSetupDialog then
g=OpenPrinterDialog(p)
If g<> Nil then
g.textfont=editarea.textfont
g.textsize=editarea.textsize
g.DrawString editarea.text, 50,50,450
p.MaxHorizontalResolution=-1
p.MaxVerticalResolution=-1
End if
End if