2015-10-12 24 views
0

我正在使用PDFCreator 2.1 COM对象在我的窗体窗体中显示PDF文件。 到目前为止,我将控件添加到Form。但我无法找到此对象(AxCPDFActiveDoc)的方式(方法或属性)来打开文件。 我知道,前段时间,acrobat阅读器曾经在他们的SDK中为我们做过这样的事情。该属性称为“src”。但在这个我找不到任何相关的东西。在ActiveX对象中查看PDF文件.NET

pdfViewer = new AxCPDFActiveDoc(); 
pdfViewer.Height = this.Height - this.ficheiroBindingNavigator.Height - this.ficheiroBindingNavigator.Top - 25; 
pdfViewer.Top = this.ficheiroBindingNavigator.Height - this.ficheiroBindingNavigator.Top; 
pdfViewer.Left = Convert.ToInt32(this.Width * 0.2) - 50; 
pdfViewer.Width = Convert.ToInt32(this.Width * 0.5); 
this.Controls.Add(pdfViewer); 

我已经在这里搜索了http://docs.pdfforge.org/pdfcreator/latest/en/com-interface/但没有什么真正与Windows窗体上的ActiveX相关的。

+1

的PDFCreator让您创建文档。要显示它们,您需要查看其他选项。例如。 [this](http://stackoverflow.com/a/4504503/115272)问题 –

+0

我管理了一种使用网络浏览器的方式。 – int3

回答

1

尝试另一个库:pdfium.net sdk例如

您可以在安装形式,它通过的NuGet 安装包pdfium.net.sdk

下一个地方的控制和使用财产以后像便接踵而来:

//Open and load a PDF document from a file. 
pdfViewer1.LoadDocument(@"c:\test001.pdf"); 

显示PDF文档