从Vb.Net应用程序打开PDF文档 [英] Open an PDF Document from Vb.Net application

查看:1006
本文介绍了从Vb.Net应用程序打开PDF文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从Vb.Net应用程序中打开PDF文档?
我想从中打开文档.我的意思是PDF文档的内容将在正常的VB.Net Windows FORM中显示为带有控件.

How I can open PDF Document from Vb.Net application?
I want to open the document within a from. I mean the content of the PDF Document will show with a control in normal VB.Net windows FORM.

推荐答案

如果要在WinForm 中打开文件可以使用COM组件中的Adobe PDF Reader控件.

对于Windows窗体,您必须在窗体上放置Adobe PDF Reader控件,然后将文件路径作为源即可传递.
If you want to open file in WinForm than you can use Adobe PDF Reader control from COM Component.

For Windows Form you have to place Adobe PDF Reader Control on you form and just pass the file path as its source.
AdobeReader.src = "C:\mydoc.pdf"



而且,如果您不想使用此控件,则只需检查一下即可..

未安装Acrobat Reader的PDF查看器控件 [



And if you dont want to use this control than just check this out..

PDF Viewer Control Without Acrobat Reader Installed[^]
[/edit]
Or, if you want to open PDF file in Adobe Reader Application than just use Process.Start() method like this:

Process myProcess = new Process();

           try
           {
         
               myProcess.StartInfo.FileName = "C:\\myPDF.pdf";
               myProcess.StartInfo.CreateNoWindow = true;
               myProcess.Start();

           }
           catch (Exception e)
           {
               MessageBox.Show(e.Message);
           }


这篇关于从Vb.Net应用程序打开PDF文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆