⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chap0702.cs

📁 iTextSharp
💻 CS
字号:
using System;
using System.IO;

using iTextSharp.text;
using iTextSharp.text.xml;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
using iTextSharp.text.rtf;

namespace iTextSharp.tutorial.Chap07
{
	/// <summary>
	/// Chap0702 的摘要说明。
	/// </summary>
	public class Chap0702
	{
		public Chap0702()
		{
			Console.WriteLine("Chapter 7 example 2: parsing the result of example 1");
        
			// step 1: creation of a document-object
			Document document = new Document();
        
			try 
			{
            
				// step 2:
				// we create a writer that listens to the document
				// and directs a XML-stream to a file
				PdfWriter.GetInstance(document, new FileStream("Chap0702.pdf", FileMode.Create));
				HtmlWriter.GetInstance(document,new FileStream("Chap0702.htm", FileMode.Create));
				RtfWriter.GetInstance(document,new FileStream("Chap0702.rtf", FileMode.Create));
				// step 3: we create a parser
				
				ITextHandler h = new ITextHandler(document);
            
				// step 4: we parse the document
				h.Parse("Chap0701.xml");

			}
			catch (Exception e) 
			{
				Console.Error.WriteLine(e.StackTrace);
				Console.Error.WriteLine(e.Message);
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -