用C# Builder生成PDF文件
添加时间: 2007-7-13 2:00:53 作者: C#教程 阅读次数:46 来源: http://www.d9soft.com
PDF的全称为Portable document.nbspFormat,即可移植文档格式,由广泛应用于专业打印领域的Postscript解释语言演化而来。为了使PDF迅速得到推广,Adobe不仅公开了技术规范,而且还免费向用户提供可以显示和打印PDF文件的Adobe Acrobat应用软件。
PDF最大的优势就在于其良好的一致性。PDF文档一旦创建之后,无论是在任何系统或打印设备上,都可以完好的保持最初的页面设计样式和风格,不会发生任何变化。正是由于PDF文档在格式上的一贯性,使得越来越多的网站开始提供基于PDF格式的文件和说明,从简单的宣传手册到完整的电子图书,PDF越来越受到人们的喜爱和重视。
事实上,除了可以用于静态信息显示之外,我们还可以通过Web脚本程序直接直接以PDF文档形式输出,不再仅仅局限于传统的HTML页面。
下面就用C# Builder生成一个简单的PDF文件:
首先,打开C# Builder,File->New->C# Application,Name这里我们设为"MKPDF"。
代码如下:
| using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Text; namespace MKPDF /// <summary> //Create a PDF file.
//Format the data length in xRef Format
public WinForm() // /// <summary> #region Windows Form Designer generated code /// <summary> private void button1_Click(object sender, System.EventArgs e) //ID 1 For Containt //1> Start a new Page //Get the start of the stream //Add the text data to the PDF memory stream //PDF文档的版本信息 //Add Page to xRefs //Build the Pages
//Add the catalog to xRefs //xRefs Entry |
上一篇文章: 用C# Builder实现文件下载程序 下一篇文章: C# Builder建一个ASP.NET应用程序
相关文章:
相关软件:

