[英]Adobe Acrobat Reader could not open pdf file because it is either not a supported file type or because the file has been damaged
[英]Open PDF File with Adobe Acrobat inside Java Application (via OLE)
我想在现有的Java(SWT)-Application中打开PDF文件。 PDF不应在外部框架中打开。 我尝试通过OLE接口,但没有成功。
clientSite = new OleControlSite(frame, SWT.NONE, "AcroExch.App", fileName);
automation = new OleAutomation(clientSite);
clientSite.doVerb(OLE.OLEIVERB_OPEN);
您可以使用IE界面,然后导航到PDF文件。
伪代码:
$Obj = ObjCreate("Shell.Explorer.2")
$Obj.Navigate('D:\Test.pdf')
或阅读器Web界面
伪代码:
$oReader = ObjCreate("AcroPDF.PDF.1")
$oReader.Load("D:\Test.pdf")
您如何在Java下询问如何将对象绑定到Java-GUI
HTH,莱因哈德
PS:“ Shell.Explorer.2”选项对我来说更有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.