Tip of the day: Print to PDF with OpenPrinter in Xojo
// get Xojo printer setup
dim p as new PrinterSetup
// now put it into NSPrintInfo to manipulate
dim n as new NSPrintInfoMBS
n.SetupString = p.SetupString
// change destination to file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.pdf")
n.SetSaveDestination(f)
// move back
p.SetupString = n.SetupString
// and print as usual
dim g as Graphics = OpenPrinter(p)
g.DrawString "Hello World", 20, 20
