C# WinForm打开PDF文件并在窗体中显示
1.添加引用
工具箱---右键---选择项--COM组件--Adobe PDF Reader
2.使用方法
代码如下:
OpenFileDialog openFile=new OpenFileDialog();
open..Filter = "PDF文件|*.pdf";
openFile.ShowDialog();
axAcroPDF1.src = openFile.FileName;
//axAcroPDF1.LoadFile(of.FileName); //使用方法二
除了这种方法,网上还有一些开源的项目,可以直接打开PDF文件,大家也可以参考下
时间: 2016-05-03
复制代码 代码如下: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; using Word = Microsoft.Office.Interop.Word;using Excel = Micro
本文实例讲述了C#编程简单实现生成PDF文档的方法.分享给大家供大家参考,具体如下: using System; using System.IO; using System.Text; using System.Collections; namespace PDFGenerator { public class PDFGenerator { static float pageWidth = 594.0f; static floa