怎样把PDF文件在WinForm窗口中显示出来

Steps to create the C# version
1. Create a windows form application by using VS

2. Make the Acrobat control available in the toolbox of VS
Tools->Add/Remove Toolbox Items: turn on "Adobe Acrobat 7.0 Browser Document" in COM Components tab. You will see it in the Toolbox's General tab.

3. Drag this control to the form. you get:
private AxAcroPDFLib.AxAcroPDF axAcroPDF1;

4. Load a pdf file and make it show up.
axAcroPDF1.LoadFile("mypdf.pdf");
axAcroPDF1.Show();
5. Compile and run, you will see the document showing up inside of the control.

Here is the code piece.
public class Form1 : System.Windows.Forms.Form
{
private AxAcroPDFLib.AxAcroPDF axAcroPDF1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

axAcroPDF1.LoadFile("mypdf.pdf");
axAcroPDF1.Show();
}

... ... ... here is the code generated by VS.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值