簡體   English   中英

在ActiveX對象.NET中查看PDF文件

[英]View PDF files in ActiveX object .NET

我正在使用PDFCreator 2.1 COM對象在Window Form中顯示PDF文件。 到目前為止,我已將控件添加到Form。 但是我找不到此對象(AxCPDFActiveDoc)打開文件的方法(方法或屬性)。 我知道,不久前,acrobat閱讀器在其SDK中曾經有一個對象可以為我們做到這一點。 該屬性稱為“ src”。 但是在此我找不到任何相關的東西。

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 Forms上的ActiveX相關的內容。

嘗試其他庫:例如pdfium.net sdk

您可以通過nuget Install-package pdfium.net.sdk進行安裝

接下來將控件放在表單上,​​並使用以下類似的東西:

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

顯示PDF文件

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM