Print without dialog

Hello,
i want to print a file without dialog on a standard printer.
My code is from the examples printer -> PrintText

Dim ps As New PrinterSetup If ps.PageSetupDialog Then Dim page As Graphics page = OpenPrinterDialog(ps) If page <> Nil Then ' Draw text on page 1 with 1 inch left/top margin Dim leftMargin As Double = ps.HorizontalResolution Dim topMargin As Double = ps.VerticalResolution page.TextSize = Val(FontPopup.Text) page.DrawString(TextArea1.Text, leftMargin, topMargin, ps.Width - leftMargin * 2) End If End If

What can i do to disable both dialogs?

use openprinter instead of openprinterdialog

Dim ps As New PrinterSetup If ps.PageSetupDialog Then Dim g As Graphics g = OpenPrinter(ps) If g <> Nil Then // Draw text 1 inch across and 1 inch down g.DrawString("Hello World", ps.HorizontalResolution, ps.VerticalResolution) End If End If

I want to print a file WITHOUT dialog on a standard printer.

With this code:

Dim ps As New PrinterSetup 'If ps.PageSetupDialog Then Dim g As Graphics g = OpenPrinter(ps) If g <> Nil Then // Draw text 1 inch across and 1 inch down g.DrawString("Hello World", ps.HorizontalResolution, ps.VerticalResolution) End If 'End If

only the dialog for the printer appears. But the standardprinter is activated.
How can i print without clicking on the standard printer?
Maybe the main error is Linux? Xojo is very buggy on Linux.

this :

Dim ps As New PrinterSetup Dim g As Graphics g = OpenPrinter(ps) If g <> Nil Then // Draw text 1 inch across and 1 inch down g.DrawString("Hello World", ps.HorizontalResolution, ps.VerticalResolution) End If

works fine on a mac. prints hello world without any dialog. I just tested it on an empty project.
so yes it must be a linux-xojo problem ?

Thats unbelievable! That doen’t work on Linux. To write a simple program takes time for days, or is impossible…

Hi Peter,

there is a Linux channel to ask questions