C# 在Windows窗体应用程序中查看PDF文件
我正在使用axAcroPDF查看win form应用程序中的PDF文件。每当我尝试运行应用程序时,我都会收到一个空的消息框,如下图所示 有人知道为什么吗?为了加载PDF文件,我将此代码添加到一个按钮中C# 在Windows窗体应用程序中查看PDF文件,c#,axacropdf,C#,Axacropdf,我正在使用axAcroPDF查看win form应用程序中的PDF文件。每当我尝试运行应用程序时,我都会收到一个空的消息框,如下图所示 有人知道为什么吗?为了加载PDF文件,我将此代码添加到一个按钮中 OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "PDF files (*.PDF)|*.PDF|All files (*.*)|*.*"; dialog.InitialDirectory
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "PDF files (*.PDF)|*.PDF|All files (*.*)|*.*";
dialog.InitialDirectory = "C:";
dialog.Title = "Select a PDF file";
if (dialog.ShowDialog() == DialogResult.OK)
{
this.Controls.Add(this.axAcroPDF1);
axAcroPDF1.src = dialog.FileName;
filname1 = dialog.FileName;
button2.Enabled = true;
图片:
我不知道这个答案是否能帮到你:我在AdobeReader9上做同样的工作,它给了我同样的消息框。然后我切换到AdobeReader10,消息框消失,我的应用程序正常工作 这是我的密码
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "pdf files (*.pdf) |*.pdf;";
dlg.ShowDialog();
if (dlg.FileName != null)
{
axAcroPDF1.setShowToolbar(true);
axAcroPDF1.LoadFile(dlg.FileName);
}
我们能看一些代码吗?