You don’t just “print” PDFs. For them to be printed you first need to open them somewhere that understands PDFs and then from there “print” using the platforms printing mechanisms.
Michel’s solution uses a separate program to open the PDF and print it, whereas on a mac Preview or declares could work. Christian’s solution opens the file internally using his plug-ins and then your program can send it to the printer.
Unless you can open the PDF somehow your only other option would be to send the PDF directly to the printer as raw data (some printers accept PDF just as they accept PostScript, HP/GL or PCL ), which is different and so unusual it wouldn’t be an obvious answer. I wouldn’t even consider this since it means replacing the print stack in your OS with your own, connecting and talking to printers directly.
I love me some RTF (I use Ted extensively, especially in automations, where I built a whole invoicing system based on it) but at this stage I have to believe RTF support in Xojo is mostly legacy and won’t ever be improved.
I don’t personally use it much from within Xojo, so I may be wrong and it’s been improved continuously for two decades, but it would be a (good) surprise if that’s the case.
Whereas a discussion about PDF support in Xojo is worthwhile (I think hooks to the system viewers and PDF generation, where available, are not a crazy proposition) the reality is that it isn’t supported today, so it’s moot asking for it to work. The options are the same: Handle it through a plug-in, handle through system calls or handle through third-party software.
Doesn’t make a difference, in this context, since neither is properly supported. But RTFD is even less compatible and even less supported, as it’s really a bundle (a directory of files) and by extension less compatible. RTFD is not really a file format but a directory format (in reality an RTF with external objects embedded).
RTFD has all the shortcomings of RTF, but with the added caveat that it only works in NeXT-derived OSes.
[quote=406097:@Jean-Yves Pochez]for the records,
on mac and linux :
does the job.[/quote]
Yes, this uses an OS utility to send to the default printer using CUPS conversions. The OS opens the PDF and converts it for the printer’s preferred language. It’s equivalent to using AppleScript in that respect.
Unix and macOS use CUPS functionality (CUPS is Apple’s) but there’s no built-in equivalent for Windows (that I know of). In mac and linux behind the scenes you’re taking advantage of CUPS and the ghostscript or cocoa’s PDF routines to convert to PCL or whatever the printer supports. All of this is not built into windows.
Keep in mind you can’t use this for the Mac App Store.