0

I'm trying to call printing of a document from my C++(XCode) application on MAC.I'm currently using Launch Services framework,but I didn't noticed where is printto option(flag).Is this supported by Launch Services at all?Is there some other way to do this?

Thanks, Marko

4

1 回答 1

0

根据Technical Note TN2082: The Enhanced Print Apple Event (in the legacy docs),您应该能够指定其值为参考keyAEPropData的类型参数。kPMPrinterAETypePMPrinter

不过,那个 TechNote 有点不清楚。似乎该keyAEPropData参数同时带有打印设置和打印机。接收者可以通过将参数的“实际”值强制为两种不同的类型来检索这两条信息。这就提出了一个问题,您是否可以使用 just 指定参数值kPMPrinterAEType并让它工作,或者它是否需要其他类型。

无论如何,您可以AEDesc为参数构造一个并将其传递给结构LSOpenFromRefSpec()passThruParams字段LSLaunchFSRefSpec

使用脚本编辑器将增强的打印 Apple 事件发送到测试应用程序然后转储该事件可能会有所帮助。这可能会弄清楚参数是如何构造的,因此您可以以相同的方式构造它。

于 2012-06-08T11:23:49.793 回答