【正文】
World))。 } // we Add a Footer that will show up on PAGE 2 HeaderFooter footer = new HeaderFooter(new Phrase(This is page: ), true)。39。 (watermark)。 // we rotate the page, starting from PAGE 2 (())。 = header。 in the right path?)。 } catch { (Are you sure you have the file 39。 // step 3: // we Add a Watermark that will show up on PAGE 1 try { Watermark watermark = new Watermark((), 200, 420)。 // step 1: creation of a documentobject Document document = new Document()。 using 。 using 。 } // step 5: we close the document ()。 } 14 catch(DocumentException de) { ()。 ()。 (Bruno Lowagie)。 (Metadata, iText, step 6, tutorial)。 // step 3: we add some metadata and open the document (Hello World example)。 // step 1: creation of a documentobject Document document = new Document()。 using 。 using 。 } /// summary /// Required method for Designer support do not modify /// the contents of this method with the code editor. /// /summary private void InitializeComponent() { += new ()。 } region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the Web Form Designer. // InitializeComponent()。 ()。 } // step 5: Close document ()。 } catch (DocumentException ex) { 12 ()。 // step 3 ()。 try { // step 2: we set the ContentType and create an instance of the Writer = application/pdf。 /// summary /// Summary description for Chap0501. /// /summary public class Chap0501 : { private void Page_Load(object sender, e) { // step 1 // need to write to memory first due to IE wanting // to know the length of the pdf beforehand MemoryStream m = new MemoryStream()。 using 。 using 。 using 。 using 。 using 。 using 。 } // step 5: we close the document ()。 } 10 catch(DocumentException de) { ()。 i++) { (Hello World, Hello Sun, Hello Moon, Hello Stars, Hello Sea, Hello Land, Hello People. )。 for (int i = 0。 // step 4: we Add a paragraph to the document Paragraph paragraph = new Paragraph()。 try { // step 2: // we create a writer that listens to the document // and directs a PDFstream to a file (document, new FileStream(, ))。 public class Chap0104 { public static void Main() { (Chapter 1 example 4: Margins)。 using 。 using 。 } // step 5: we close the document ()。 } } catch(DocumentException de) { ()。 i 20。 // step 3: we open the document ()。 // step 1: creation of a documentobject Document document = new Document(())。 using 。 using 。 } } 7 示例代碼 0103 using System。 6 } catch(IOException ioe) { ()。 i++) { (new Paragraph(Hello World))。 // step 4: we Add some paragraphs to the document for (int i = 0。 try { // step 2: // we create a writer that listens to the document // and directs a PDFstream to a file (document, new FileStream(, ))。 = new Color(0xFF, 0xFF, 0xDE)。 public class Chap0102 { public static void Main() { (Chapter 1 example 2: PageSize)。 using 。 } } 5 示例代碼 0102 using System。 } catch(IOException ioe) { ()。 // step 4: we Add a paragraph to the document (new Paragraph(Hello World))。 try { // step 2: // we create a writer that listens to the document // and directs a PDFstream to a file (document, new FileStream(, ))。 public class Chap0101 { public static void Main() { (Chapter 1 example 1: Hello World)。 using 。 1 示例代碼目錄 示例代碼 0101............................................................................................................... 3 示例代碼 0102............................................................................................................... 5 示例代碼 0103............................................................................................................... 7 示例代碼 0104............................................................................................................... 9 示例代碼 0105............................................................................................................. 11 示例代碼 0106............................................................................................................. 13 示例代碼 0107............................................................................................................. 15 示例代碼 0108............................................................................................................. 18 示例代碼 0109............................................................................................................. 21 示例代碼 0110 ............................................................................................................. 22 示例代碼 0111 ............................................................................................................. 23 示例代碼 0201............................................................................................................. 27 示例代碼 0202........................................................................