Document document = new Document();
Section section = document.AddSection();
section.AddParagraph("Hello, World!");
section.AddParagraph();
Paragraph paragraph = section.AddParagraph(); paragraph.Format.Font.Color = Color.FromCmyk(100, 30, 20, 50); paragraph.AddFormattedText("Hello, World!", TextFormat.Underline);
FormattedText ft = paragraph.AddFormattedText("Small text", TextFormat.Bold); ft.Font.Size = 6;
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(false, PdfFontEmbedding.Always);
pdfRenderer.Document = document;
pdfRenderer.RenderDocument();
string filename = "HelloWorld.pdf"; pdfRenderer.PdfDocument.Save(filename);
Process.Start(filename);