//public static PdfFlowTextContent GeneratePdfContent(List<string> pdfText, Models.Dosar dosar) public static PdfFormattedContent GeneratePdfContent(List <string> pdfText, Models.Dosar dosar) { Models.SocietateAsigurare sCasco = (Models.SocietateAsigurare)dosar.GetSocietateCasco().Result; Models.SocietateAsigurare sRca = (Models.SocietateAsigurare)dosar.GetSocietateRca().Result; Models.Asigurat aCasco = (Models.Asigurat)dosar.GetAsiguratCasco().Result; Models.Asigurat aRca = (Models.Asigurat)dosar.GetAsiguratRca().Result; Models.Auto autoCasco = (Models.Auto)dosar.GetAutoCasco().Result; Models.Auto autoRca = (Models.Auto)dosar.GetAutoRca().Result; Dictionary <string, string> field_names = new Dictionary <string, string>(); field_names.Add("{{NR_SCA}}", dosar.NR_SCA == null || dosar.NR_SCA.Trim() == "" ? "_________" : dosar.NR_SCA); field_names.Add("{{DATA_SCA}}", dosar.DATA_SCA == null ? "____________" : Convert.ToDateTime(dosar.DATA_SCA).Year.ToString()); field_names.Add("{{NR_DOSAR_CASCO}}", dosar.NR_DOSAR_CASCO == null || dosar.NR_DOSAR_CASCO.Trim() == "" ? "_________________" : dosar.NR_DOSAR_CASCO); field_names.Add("{{VALOARE_DAUNA}}", dosar.VALOARE_DAUNA.ToString().Trim() == "" ? "___________" : dosar.VALOARE_DAUNA.ToString()); field_names.Add("{{NR_POLITA_CASCO}}", dosar.NR_POLITA_CASCO == null || dosar.NR_POLITA_CASCO.Trim() == "" ? "_________________" : dosar.NR_POLITA_CASCO); field_names.Add("{{NR_POLITA_RCA}}", dosar.NR_POLITA_RCA == null || dosar.NR_POLITA_RCA.Trim() == "" ? "_________________" : dosar.NR_POLITA_RCA); field_names.Add("{{DATA_EVENIMENT}}", dosar.DATA_EVENIMENT == null ? "___________" : Convert.ToDateTime(dosar.DATA_EVENIMENT).ToString("dd/MM/yyyy")); field_names.Add("{{SOCIETATE_CASCO}}", sCasco.DENUMIRE == null || sCasco.DENUMIRE.Trim() == "" ? "__________________________________" : sCasco.DENUMIRE); field_names.Add("{{ADRESA_SOCIETATE_CASCO}}", sCasco.ADRESA == null || sCasco.ADRESA.Trim() == "" ? "___________________________________________________" : sCasco.ADRESA); field_names.Add("{{NR_REG_COM_SOCIETATE_CASCO}}", sCasco.NR_REG_COM == null || sCasco.NR_REG_COM.Trim() == "" ? "_______________" : sCasco.NR_REG_COM.ToUpper()); field_names.Add("{{CUI_SOCIETATE_CASCO}}", sCasco.CUI == null || sCasco.CUI.Trim() == "" ? "______________" : sCasco.CUI.ToUpper()); field_names.Add("{{IBAN_SOCIETATE_CASCO}}", sCasco.IBAN == null || sCasco.IBAN.Trim() == "" ? "__________________________________________" : sCasco.IBAN.ToUpper()); field_names.Add("{{BANCA_SOCIETATE_CASCO}}", sCasco.BANCA == null || sCasco.BANCA.Trim() == "" ? "____________________________________" : sCasco.BANCA.ToUpper()); field_names.Add("{{SOCIETATE_RCA}}", sRca.DENUMIRE == null || sRca.DENUMIRE.Trim() == "" ? "_________________________________" : sRca.DENUMIRE); field_names.Add("{{ADRESA_SOCIETATE_RCA}}", sRca.ADRESA == null || sRca.ADRESA.Trim() == "" ? "___________________________________________________" : sRca.ADRESA); field_names.Add("{{ASIGURAT_CASCO}}", aCasco.DENUMIRE == null || aCasco.DENUMIRE.Trim() == "" ? "__________________________________" : aCasco.DENUMIRE); field_names.Add("{{ASIGURAT_RCA}}", aRca.DENUMIRE == null || aRca.DENUMIRE.Trim() == "" ? "__________________________________" : aRca.DENUMIRE); field_names.Add("{{NR_AUTO_CASCO}}", autoCasco.NR_AUTO == null || autoCasco.NR_AUTO.Trim() == "" ? "____________" : autoCasco.NR_AUTO.ToUpper()); field_names.Add("{{MARCA_AUTO_CASCO}}", autoCasco.MARCA == null || autoCasco.MARCA.Trim() == "" ? "______________" : autoCasco.MARCA.ToUpper()); field_names.Add("{{NR_AUTO_RCA}}", autoRca.NR_AUTO == null || autoRca.NR_AUTO.Trim() == "" ? "____________" : autoRca.NR_AUTO.ToUpper()); field_names.Add("{{PROPRIETAR_AUTO_RCA}}", "_______________________"); field_names.Add("{{NORMA}}", dosar.DATA_EVENIMENT < new DateTime(2015, 1, 1) ? Articole.articole[0].Ordin : dosar.DATA_EVENIMENT >= new DateTime(2015, 1, 1) && dosar.DATA_EVENIMENT <= new DateTime(2016, 12, 22) ? Articole.articole[1].Ordin : Articole.articole[2].Ordin); field_names.Add("{{ARTICOL_PLATA}}", dosar.DATA_EVENIMENT < new DateTime(2015, 1, 1) ? Articole.articole[0].ArticolPlata : dosar.DATA_EVENIMENT >= new DateTime(2015, 1, 1) && dosar.DATA_EVENIMENT <= new DateTime(2016, 12, 22) ? Articole.articole[1].ArticolPlata : Articole.articole[2].ArticolPlata); field_names.Add("{{ARTICOL_OBIECTIUNI}}", dosar.DATA_EVENIMENT < new DateTime(2015, 1, 1) ? Articole.articole[0].ArticolObiectiuni : dosar.DATA_EVENIMENT >= new DateTime(2015, 1, 1) && dosar.DATA_EVENIMENT <= new DateTime(2016, 12, 22) ? Articole.articole[1].ArticolObiectiuni : Articole.articole[2].ArticolObiectiuni); field_names.Add("{{TERMEN}}", dosar.DATA_EVENIMENT < new DateTime(2015, 1, 1) ? Articole.articole[0].NrZile : dosar.DATA_EVENIMENT >= new DateTime(2015, 1, 1) && dosar.DATA_EVENIMENT <= new DateTime(2016, 12, 22) ? Articole.articole[1].NrZile : Articole.articole[2].NrZile); field_names.Add("{{CAZ}}", dosar.CAZ == null || dosar.CAZ.Trim() == "" ? "_____" : dosar.CAZ); field_names.Add("{{DATA}}", DateTime.Now.ToString("dd/MM/yyyy")); string docs = ""; //pentru insiruirea in opis a tuturor documentelor, negrupate pe tip /* * Models.DocumentScanat[] dsj = (Models.DocumentScanat[])dosar.GetDocumente().Result; * foreach (Models.DocumentScanat doc in dsj) * { * Models.Nomenclator tip_document = (Models.Nomenclator)doc.GetTipDocument().Result; * //docs = String.Format("- {1}\r\n{0}", docs, (doc.DETALII != "" && doc.DETALII != null ? doc.DETALII : doc.DENUMIRE_FISIER)); * docs = String.Format("- {1}\r\n{0}", docs, tip_document.DENUMIRE + " " + (doc.DETALII != "" && doc.DETALII != null ? doc.DETALII : "")); * } */ object[] DocumenteTipuri = (object[])dosar.GetDocumenteTipuri().Result; foreach (object[] documentTip in DocumenteTipuri) { docs = String.Format("{0}\r\n- {1}{2}", docs, documentTip[1].ToString(), Convert.ToInt32(documentTip[2]) > 1 ? " (" + documentTip[2].ToString() + " file)" : ""); } field_names.Add("{{DOCUMENTE}}", docs); PdfUnicodeTrueTypeFont boldFont = new PdfUnicodeTrueTypeFont(new FileStream(Path.Combine(AppContext.BaseDirectory, "Content", "arialbold.ttf"), FileMode.Open, FileAccess.Read, FileShare.Read), 12, true); PdfUnicodeTrueTypeFont regularFont = new PdfUnicodeTrueTypeFont(new FileStream(Path.Combine(AppContext.BaseDirectory, "Content", "arial.ttf"), FileMode.Open, FileAccess.Read, FileShare.Read), 12, true); PdfFormattedContent pfc = new PdfFormattedContent(); foreach (string s in pdfText) { PdfFormattedParagraph pfp = new PdfFormattedParagraph(); pfp.LineSpacingMode = PdfFormattedParagraphLineSpacing.Multiple; pfp.LineSpacing = 1.3; pfp.SpacingAfter = 15; if (s.IndexOf("{{NR_SCA}}") > -1) { pfp.HorizontalAlign = PdfStringHorizontalAlign.Right; } else if (s.IndexOf("CERERE DE DESPAGUBIRE") > -1) { pfp.HorizontalAlign = PdfStringHorizontalAlign.Center; } else { pfp.HorizontalAlign = PdfStringHorizontalAlign.Justified; if (s.IndexOf("Catre") < 0 && s.IndexOf("{{DOCUMENTE}}") < 0 && s.IndexOf("$$") < 0) { pfp.FirstLineIndent = 30; } if (s.IndexOf("{{DOCUMENTE}}") > -1 || s.IndexOf("$$") > -1) { pfp.LeftIndentation = 50; } } List <string> splitters = new List <string>(); foreach (KeyValuePair <string, string> field in field_names) { if (s.IndexOf(field.Key) > -1) { splitters.Add(field.Key); } } string[] sBlocks = null; if (splitters.Count > 0) { sBlocks = s.Split(splitters.ToArray(), StringSplitOptions.None); } else { sBlocks = new string[] { s } }; int splitter_count = 0; for (int i = 0; i < sBlocks.Length; i++) { try { PdfFormattedTextBlock b1 = new PdfFormattedTextBlock(sBlocks[i].Replace("$$", "\r\n"), sBlocks[i].IndexOf("CERERE DE DESPAGUBIRE") > -1 ? boldFont : regularFont); pfp.Blocks.Add(b1); string theFuckingWrightSplitter = ""; //if (splitter_count < splitters.Count) { foreach (string splitter in splitters) { if (s.IndexOf(sBlocks[i] + splitter) > -1) { theFuckingWrightSplitter = splitter; splitter_count++; splitters.Remove(splitter); break; } } //PdfFormattedTextBlock b2 = new PdfFormattedTextBlock(field_names[splitters[i]], boldFont); PdfFormattedTextBlock b2 = new PdfFormattedTextBlock(field_names[theFuckingWrightSplitter], boldFont); pfp.Blocks.Add(b2); } } catch { } } pfc.Paragraphs.Add(pfp); } //pfc.SplitByBox(485, 742); //PdfFlowTextContent pftc = new PdfFlowTextContent(pfc); //return pftc; return(pfc); }
/// <summary> /// Converts simple XHTML to a formatted content object. /// </summary> /// <param name="html"></param> /// <returns></returns> private PdfFormattedContent ConvertHtmlToFormattedContent(Stream html) { PdfFormattedContent fc = new PdfFormattedContent(); PdfFormattedParagraph currentParagraph = null; PdfUriAction currentLinkAction = null; PdfFormattedTextBlock bullet = null; float currentIndent = 0; // Create a default font. fonts.Push(new PdfStandardFont(PdfStandardFontFace.Helvetica, 10)); // Create a default text color. textColors.Push(new PdfBrush(PdfRgbColor.Black)); System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(html); xmlReader.MoveToContent(); while (xmlReader.Read()) { switch (xmlReader.NodeType) { case System.Xml.XmlNodeType.Element: switch (xmlReader.Name) { case "p": currentParagraph = new PdfFormattedParagraph(); //currentParagraph.SpacingBefore = 3; //currentParagraph.SpacingAfter = 3; fc.Paragraphs.Add(currentParagraph); break; case "br": if (currentParagraph.Blocks.Count > 0) { PdfFormattedTextBlock textBlock = currentParagraph.Blocks[currentParagraph.Blocks.Count - 1] as PdfFormattedTextBlock; textBlock.Text = textBlock.Text + "\r\n"; } else { PdfFormattedTextBlock textBlock = new PdfFormattedTextBlock("\r\n", ActiveFont); currentParagraph.Blocks.Add(textBlock); } break; case "a": while (xmlReader.MoveToNextAttribute()) { if (xmlReader.Name == "href") { currentLinkAction = new PdfUriAction(); currentLinkAction.URI = xmlReader.Value; } } break; case "font": while (xmlReader.MoveToNextAttribute()) { if (xmlReader.Name == "color") { PdfBrush color = ActiveTextColor; string colorCode = xmlReader.Value; // #RRGGBB if (colorCode.StartsWith("#") && (colorCode.Length == 7)) { byte r = byte.Parse(colorCode.Substring(1, 2), System.Globalization.NumberStyles.HexNumber); byte g = byte.Parse(colorCode.Substring(3, 2), System.Globalization.NumberStyles.HexNumber); byte b = byte.Parse(colorCode.Substring(5, 2), System.Globalization.NumberStyles.HexNumber); color = new PdfBrush(new PdfRgbColor(r, g, b)); } textColors.Push(color); } } break; case "ul": //bullet = new PdfFormattedTextBlock("\x95 ", ActiveFont); currentIndent += 18; break; case "li": currentParagraph = new PdfFormattedParagraph(); currentParagraph.SpacingBefore = 3; currentParagraph.SpacingAfter = 3; currentParagraph.Bullet = bullet; currentParagraph.LeftIndentation = currentIndent; fc.Paragraphs.Add(currentParagraph); break; case "b": case "strong": PdfFont boldFont = CopyFont(ActiveFont); boldFont.Bold = true; fonts.Push(boldFont); break; case "i": case "em": PdfFont italicFont = CopyFont(ActiveFont); italicFont.Italic = true; fonts.Push(italicFont); break; case "u": PdfFont underlineFont = CopyFont(ActiveFont); underlineFont.Underline = true; fonts.Push(underlineFont); break; case "span": if (currentParagraph == null) { currentParagraph = new PdfFormattedParagraph(); fc.Paragraphs.Add(currentParagraph); } break; case "h1": case "h2": currentParagraph = new PdfFormattedParagraph(); currentParagraph.SpacingBefore = 6; currentParagraph.SpacingAfter = 6; fc.Paragraphs.Add(currentParagraph); fonts.Push(CopyFont(new PdfStandardFont(PdfStandardFontFace.Helvetica, 17))); break; case "h3": case "h4": currentParagraph = new PdfFormattedParagraph(); currentParagraph.SpacingBefore = 6; //currentParagraph.SpacingAfter = 6; fc.Paragraphs.Add(currentParagraph); fonts.Push(CopyFont(new PdfStandardFont(PdfStandardFontFace.Helvetica, 14))); break; case "h5": case "h6": currentParagraph = new PdfFormattedParagraph(); currentParagraph.SpacingBefore = 3; currentParagraph.SpacingAfter = 3; fc.Paragraphs.Add(currentParagraph); fonts.Push(CopyFont(new PdfStandardFont(PdfStandardFontFace.Helvetica, 11))); break; } break; case System.Xml.XmlNodeType.EndElement: switch (xmlReader.Name) { case "a": currentLinkAction = null; break; case "ul": //bullet = null; currentIndent -= 18; break; case "b": case "strong": case "i": case "em": case "u": case "h1": case "h2": case "h3": case "h4": case "h5": case "h6": currentParagraph = new PdfFormattedParagraph(); currentParagraph.SpacingBefore = 0; currentParagraph.SpacingAfter = 0; fc.Paragraphs.Add(currentParagraph); fonts.Pop(); break; case "font": if (textColors.Count > 1) { textColors.Pop(); } break; } break; case System.Xml.XmlNodeType.Text: string text = xmlReader.Value; if (currentParagraph != null && text != null && text.Length > 0) { // Remove spaces from text that do not have meaning in HTML. text = text.Replace("\r", ""); text = text.Replace("\n", ""); text = text.Replace("\t", " "); PdfFormattedTextBlock block = new PdfFormattedTextBlock(text, ActiveFont); block.TextColor = ActiveTextColor; if (currentLinkAction != null) { block.Action = currentLinkAction; // Make the links blue. block.TextColor = new PdfBrush(PdfRgbColor.Blue); } currentParagraph.Blocks.Add(block); } break; } } return(fc); }
/// <summary> /// Main method for running the sample. /// </summary> public static SampleOutputInfo[] Run() { string xfiniumPdfText = "XFINIUM.PDF"; string paragraph1Block2Text = " library is a .NET/Xamarin library for cross-platform PDF development. Code written for "; string paragraph1Block4Text = " can be compiled on all supported platforms without changes. The library features a " + "wide range of capabilities, for both beginers and advanced PDF developers."; string paragraph2Block1Text = "The development style is based on fixed document model, where each page is created as needed " + "and content is placed at fixed position using a grid based layout.\r\n" + "This gives you access to all PDF features, whether you want to create a simple file " + "or you want to create a transparency knockout group at COS level, and lets you build more complex models on top of the library."; string paragraph3Block2Text = " has been developed entirely in C# and it is 100% managed code."; string paragraph4Block1Text = "With "; string paragraph4Block3Text = " you can port your PDF application logic to other platforms with zero effort which means faster time to market."; string paragraph5Block1Text = "Simple licensing per developer with royalty free distribution helps you keep your costs under control."; string paragraph6Block1Text = "SUPPORTED PLATFORMS"; string paragraph7Block1Text = ".NET 2.0 to .NET 4.5"; string paragraph8Block1Text = "Windows Forms"; string paragraph9Block1Text = "ASP.NET Webforms and MVC"; string paragraph10Block1Text = "Console applications"; string paragraph11Block1Text = "Windows services"; string paragraph12Block1Text = "Mono"; string paragraph13Block1Text = "WPF 4.0 & 4.5"; string paragraph14Block1Text = "Silverlight 4 & 5"; string paragraph15Block1Text = "WinRT (Windows Store applications)"; string paragraph16Block1Text = "Windows Phone 7 & 8"; string paragraph17Block1Text = "Xamarin.iOS"; string paragraph18Block1Text = "Xamarin.Android"; PdfStandardFont textFont = new PdfStandardFont(PdfStandardFontFace.Helvetica, 10); PdfFormattedTextBlock xfiniumPdfLinkBlock = new PdfFormattedTextBlock(xfiniumPdfText); xfiniumPdfLinkBlock.Font = new PdfStandardFont(PdfStandardFontFace.HelveticaBold, 10); xfiniumPdfLinkBlock.Font.Underline = true; xfiniumPdfLinkBlock.TextColor = new PdfBrush(PdfRgbColor.Blue); xfiniumPdfLinkBlock.Action = new PdfUriAction("http://xfiniumpdf.com/"); PdfFormattedParagraph paragraph1 = new PdfFormattedParagraph(); paragraph1.LineSpacingMode = PdfFormattedParagraphLineSpacing.Multiple; paragraph1.LineSpacing = 1.2; paragraph1.SpacingAfter = 3; paragraph1.FirstLineIndent = 10; paragraph1.HorizontalAlign = PdfStringHorizontalAlign.Justified; paragraph1.Blocks.Add(xfiniumPdfLinkBlock); paragraph1.Blocks.Add(new PdfFormattedTextBlock(paragraph1Block2Text, textFont)); paragraph1.Blocks.Add(xfiniumPdfLinkBlock); paragraph1.Blocks.Add(new PdfFormattedTextBlock(paragraph1Block4Text, textFont)); PdfFormattedParagraph paragraph2 = new PdfFormattedParagraph(); paragraph2.SpacingAfter = 3; paragraph2.FirstLineIndent = 10; paragraph2.HorizontalAlign = PdfStringHorizontalAlign.Justified; paragraph2.LineSpacingMode = PdfFormattedParagraphLineSpacing.Multiple; paragraph2.LineSpacing = 1.2; paragraph2.Blocks.Add(new PdfFormattedTextBlock(paragraph2Block1Text, textFont)); PdfFormattedParagraph paragraph3 = new PdfFormattedParagraph(); paragraph3.LineSpacingMode = PdfFormattedParagraphLineSpacing.Multiple; paragraph3.LineSpacing = 1.2; paragraph3.SpacingAfter = 3; paragraph3.FirstLineIndent = 10; paragraph3.HorizontalAlign = PdfStringHorizontalAlign.Justified; paragraph3.Blocks.Add(xfiniumPdfLinkBlock); paragraph3.Blocks.Add(new PdfFormattedTextBlock(paragraph3Block2Text, textFont)); PdfFormattedParagraph paragraph4 = new PdfFormattedParagraph(); paragraph4.LineSpacingMode = PdfFormattedParagraphLineSpacing.Multiple; paragraph4.LineSpacing = 1.2; paragraph4.SpacingAfter = 3; paragraph4.FirstLineIndent = 10; paragraph4.HorizontalAlign = PdfStringHorizontalAlign.Justified; paragraph4.Blocks.Add(new PdfFormattedTextBlock(paragraph4Block1Text, textFont)); paragraph4.Blocks.Add(xfiniumPdfLinkBlock); paragraph4.Blocks.Add(new PdfFormattedTextBlock(paragraph4Block3Text, textFont)); PdfFormattedParagraph paragraph5 = new PdfFormattedParagraph(); paragraph5.FirstLineIndent = 10; paragraph5.HorizontalAlign = PdfStringHorizontalAlign.Justified; paragraph5.Blocks.Add(new PdfFormattedTextBlock(paragraph5Block1Text, textFont)); PdfFormattedParagraph paragraph6 = new PdfFormattedParagraph(); paragraph6.SpacingBefore = 10; paragraph6.Blocks.Add(new PdfFormattedTextBlock(paragraph6Block1Text, textFont)); PdfFormattedTextBlock bulletBlock = new PdfFormattedTextBlock("\x76 ", new PdfStandardFont(PdfStandardFontFace.ZapfDingbats, 10)); PdfFormattedParagraph paragraph7 = new PdfFormattedParagraph(); paragraph7.SpacingBefore = 3; paragraph7.Bullet = bulletBlock; paragraph7.LeftIndentation = 10; paragraph7.Blocks.Add(new PdfFormattedTextBlock(paragraph7Block1Text, textFont)); PdfFormattedParagraph paragraph8 = new PdfFormattedParagraph(); paragraph8.SpacingBefore = 3; paragraph8.Bullet = bulletBlock; paragraph8.LeftIndentation = 10; paragraph8.Blocks.Add(new PdfFormattedTextBlock(paragraph8Block1Text, textFont)); PdfFormattedParagraph paragraph9 = new PdfFormattedParagraph(); paragraph9.SpacingBefore = 3; paragraph9.Bullet = bulletBlock; paragraph9.LeftIndentation = 10; paragraph9.Blocks.Add(new PdfFormattedTextBlock(paragraph9Block1Text, textFont)); PdfFormattedParagraph paragraph10 = new PdfFormattedParagraph(); paragraph10.SpacingBefore = 3; paragraph10.Bullet = bulletBlock; paragraph10.LeftIndentation = 10; paragraph10.Blocks.Add(new PdfFormattedTextBlock(paragraph10Block1Text, textFont)); PdfFormattedParagraph paragraph11 = new PdfFormattedParagraph(); paragraph11.SpacingBefore = 3; paragraph11.Bullet = bulletBlock; paragraph11.LeftIndentation = 10; paragraph11.Blocks.Add(new PdfFormattedTextBlock(paragraph11Block1Text, textFont)); PdfFormattedParagraph paragraph12 = new PdfFormattedParagraph(); paragraph12.SpacingBefore = 3; paragraph12.Bullet = bulletBlock; paragraph12.LeftIndentation = 10; paragraph12.Blocks.Add(new PdfFormattedTextBlock(paragraph12Block1Text, textFont)); PdfFormattedParagraph paragraph13 = new PdfFormattedParagraph(); paragraph13.SpacingBefore = 3; paragraph13.Bullet = bulletBlock; paragraph13.LeftIndentation = 10; paragraph13.Blocks.Add(new PdfFormattedTextBlock(paragraph13Block1Text, textFont)); PdfFormattedParagraph paragraph14 = new PdfFormattedParagraph(); paragraph14.SpacingBefore = 3; paragraph14.Bullet = bulletBlock; paragraph14.LeftIndentation = 10; paragraph14.Blocks.Add(new PdfFormattedTextBlock(paragraph14Block1Text, textFont)); PdfFormattedParagraph paragraph15 = new PdfFormattedParagraph(); paragraph15.SpacingBefore = 3; paragraph15.Bullet = bulletBlock; paragraph15.LeftIndentation = 10; paragraph15.Blocks.Add(new PdfFormattedTextBlock(paragraph15Block1Text, textFont)); PdfFormattedParagraph paragraph16 = new PdfFormattedParagraph(); paragraph16.SpacingBefore = 3; paragraph16.Bullet = bulletBlock; paragraph16.LeftIndentation = 10; paragraph16.Blocks.Add(new PdfFormattedTextBlock(paragraph16Block1Text, textFont)); PdfFormattedParagraph paragraph17 = new PdfFormattedParagraph(); paragraph17.SpacingBefore = 3; paragraph17.Bullet = bulletBlock; paragraph17.LeftIndentation = 10; paragraph17.Blocks.Add(new PdfFormattedTextBlock(paragraph17Block1Text, textFont)); PdfFormattedParagraph paragraph18 = new PdfFormattedParagraph(); paragraph18.SpacingBefore = 3; paragraph18.Bullet = bulletBlock; paragraph18.LeftIndentation = 10; paragraph18.Blocks.Add(new PdfFormattedTextBlock(paragraph18Block1Text, textFont)); PdfFormattedContent formattedContent = new PdfFormattedContent(); formattedContent.Paragraphs.Add(paragraph1); formattedContent.Paragraphs.Add(paragraph2); formattedContent.Paragraphs.Add(paragraph3); formattedContent.Paragraphs.Add(paragraph4); formattedContent.Paragraphs.Add(paragraph5); formattedContent.Paragraphs.Add(paragraph6); formattedContent.Paragraphs.Add(paragraph7); formattedContent.Paragraphs.Add(paragraph8); formattedContent.Paragraphs.Add(paragraph9); formattedContent.Paragraphs.Add(paragraph10); formattedContent.Paragraphs.Add(paragraph11); formattedContent.Paragraphs.Add(paragraph12); formattedContent.Paragraphs.Add(paragraph13); formattedContent.Paragraphs.Add(paragraph14); formattedContent.Paragraphs.Add(paragraph15); formattedContent.Paragraphs.Add(paragraph16); formattedContent.Paragraphs.Add(paragraph17); formattedContent.Paragraphs.Add(paragraph18); PdfFixedDocument document = new PdfFixedDocument(); PdfPage page = document.Pages.Add(); page.Graphics.DrawFormattedContent(formattedContent, 50, 50, 500, 700); page.Graphics.CompressAndClose(); SampleOutputInfo[] output = new SampleOutputInfo[] { new SampleOutputInfo(document, "xfinium.pdf.sample.formattedcontent.pdf") }; return output; }