Print to PDF - file does not exist

I believe this is more OSX than Xojo related. In my software I print data together with lightweight graphics. For example I print 5 sites together to a pdf file with a complete weight of 41 KB.

The pdf is created within the OSX print dialog - Open pdf in preview. Sometimes there comes a dilaog that says: the file could not be opened, because it does not exist. Then by closing this message window the pdf file with the data is shown.

Can I prevent this message dialog to appear?

is your Text in a TextArea?

In myTextareaExample
is a PDF Preview Button (Preview without Print Dialog) , maybe it works for you.

Hi Axel,

thanks for the example code. I will have a look into it after lunch.

The software doesn’t use a textarea control. It uses the graphics object drawing functions to print directly into the printers page.