| 1: | using System; | |
| 2: | using System.IO; | |
| 3: | using iTextSharp.text; | |
| 4: | using iTextSharp.text.pdf; | |
| 5: | //using iTextSharp.text.html; | |
| 6: | using iTextSharp.text.xml; | |
| 7: | //using iTextSharp.text.rtf; | |
| 8: | ||
| 9: | namespace iTextSharp.tutorial.Chap07 | |
| 10: | { | |
| 11: | /// <summary> | |
| 12: | /// resume To PDF | |
| 13: | /// </summary> | |
| 14: | public class Cv | |
| 15: | { | |
| 16: | public Cv() | |
| 17: | { | |
| 18: | ||
| 19: | Console.WriteLine("Chapter 7 extra: my resume"); | |
| 20: | ||
| 21: | // step 1: creation of a document-object | |
| 22: | Document document = new Document(PageSize.A4, 80, 50, 30, 65); | |
| 23: | ||
| 24: | try { | |
| 25: | ||
| 26: | // step 2: | |
| 27: | // we create a writer that listens to the document | |
| 28: | // and directs a XML-stream to a file | |
| 29: | PdfWriter.GetInstance(document, new FileStream("cv.pdf", FileMode.Create)); | |
| 30: | ||
| 31: | // step 3: we parse the document | |
| 32: | XmlParser.Parse(document, "cv.xml"); | |
| 33: | ||
| 34: | } | |
| 35: | catch(Exception e) { | |
| 36: | ||
| 37: | Console.WriteLine(e.Message); | |
| 38: | } | |
| 39: | } | |
| 40: | } | |
| 41: | } |