Xojo Conferences

« New universal Hash an… | Home | FileMaker Meeting in … »

Print to PDF File on Mac OS X with Xojo

Today I found a way to print to PDF file in Cocoa app with Xojo. Next plugin prerelease will have the required functions to have this code work:

Sub Action() // print to PDF in Xojo Cocoa app // change print info to go to dim s as NSPrintInfoMBS = NSPrintInfoMBS.sharedPrintInfo dim d as MemoryBlock = s.data // save old s.SetSaveDestination SpecialFolder.Desktop.Child("test.pdf") // now print something dim g as Graphics = OpenPrinter If g <> Nil Then g.DrawString "Hello World PDF", 20, 20 End If s.data = d // restore original settings // now print something to regular printer g = OpenPrinter If g <> Nil Then g.DrawString "Hello World Printer", 20, 20 End If End Sub

PS: New plugin is in dropbox.
24 02 14 - 15:55
one comment

Kennt jemand eine möglichkeit genau das gleiche unter Windows zu tun?
Oliver Schellhammer - 06 06 14 - 11:07

Remember personal info?

Emoticons / Textile

Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.