准备:
下载两个控件: itextsharp.dll 和 ICSharpCode.SharpZipLib.dll
在项目引用中添加以上两个文件, 并在代码里添加下面代码即可
using iTextSharp.text;
using iTextSharp.text.pdf;
HelloWorld:
static void Main(string[] args) { Document doc = new Document(); PdfWriter.GetInstance(doc, new FileStream("Chap0101.pdf", FileMode.Create)); doc.Open(); doc.Add(new Paragraph("Hello World")); doc.Close(); System.Console.ReadKey(); }