コード例 #1
0
        private static PDFFlowContent BuildSubscript(PDFAnsiTrueTypeFont font)
        {
            PDFAnsiTrueTypeFont fontSubscript = new PDFAnsiTrueTypeFont(font, 18);
            PDFAnsiTrueTypeFont fontRegular   = new PDFAnsiTrueTypeFont(font, 12);

            PDFFormattedContent content  = new PDFFormattedContent();
            PDFFlowTextContent  flowText = new PDFFlowTextContent(content);

            flowText.OuterMargins = new PDFFlowContentMargins(0, 0, 36, 0);

            PDFFormattedTextBlock titleBlock = new PDFFormattedTextBlock("Subscript text", fontRegular);

            content.Paragraphs.Add(new PDFFormattedParagraph(titleBlock));
            content.Paragraphs.Add(new PDFFormattedParagraph(" "));

            PDFFormattedTextBlock block1 = new PDFFormattedTextBlock("Y = X", font);

            block1.Subscript.Add(new PDFFormattedTextBlock("1", fontSubscript));
            PDFFormattedTextBlock block2 = new PDFFormattedTextBlock(" + X", font);

            block2.Subscript.Add(new PDFFormattedTextBlock("2", fontSubscript));
            PDFFormattedTextBlock block3 = new PDFFormattedTextBlock(" + X", font);

            block3.Subscript.Add(new PDFFormattedTextBlock("3", fontSubscript));
            PDFFormattedTextBlock blockn = new PDFFormattedTextBlock(" + ... + X", font);

            blockn.Subscript.Add(new PDFFormattedTextBlock("n", fontSubscript));

            PDFFormattedParagraph paragraph = new PDFFormattedParagraph(block1, block2, block3, blockn);

            paragraph.HorizontalAlign = PDFStringHorizontalAlign.Center;
            content.Paragraphs.Add(paragraph);

            return(flowText);
        }
コード例 #2
0
        private static PDFFlowContent BuildSuperscript(PDFAnsiTrueTypeFont font)
        {
            PDFAnsiTrueTypeFont fontSuperscript = new PDFAnsiTrueTypeFont(font, 18);
            PDFAnsiTrueTypeFont fontRegular     = new PDFAnsiTrueTypeFont(font, 12);

            PDFFormattedContent content  = new PDFFormattedContent();
            PDFFlowTextContent  flowText = new PDFFlowTextContent(content);

            PDFFormattedTextBlock titleBlock = new PDFFormattedTextBlock("Superscript text", fontRegular);

            content.Paragraphs.Add(new PDFFormattedParagraph(titleBlock));
            content.Paragraphs.Add(new PDFFormattedParagraph(" "));

            PDFFormattedTextBlock xBlock = new PDFFormattedTextBlock("X", font);

            xBlock.Superscript.Add(new PDFFormattedTextBlock("2", fontSuperscript));
            PDFFormattedTextBlock yBlock = new PDFFormattedTextBlock(" + Y", font);

            yBlock.Superscript.Add(new PDFFormattedTextBlock("2", fontSuperscript));
            PDFFormattedTextBlock zBlock = new PDFFormattedTextBlock(" = Z", font);

            zBlock.Superscript.Add(new PDFFormattedTextBlock("2", fontSuperscript));

            PDFFormattedParagraph paragraph = new PDFFormattedParagraph(xBlock, yBlock, zBlock);

            paragraph.HorizontalAlign = PDFStringHorizontalAlign.Center;
            content.Paragraphs.Add(paragraph);

            return(flowText);
        }
コード例 #3
0
        private static PDFFlowContent BuildEndSection(PDFAnsiTrueTypeFont verdana)
        {
            PDFAnsiTrueTypeFont headerFont = new PDFAnsiTrueTypeFont(verdana);

            headerFont.Size = 20;
            PDFAnsiTrueTypeFont contentFont = new PDFAnsiTrueTypeFont(verdana);

            contentFont.Size = 12;

            PDFFormattedContent endInfo = new PDFFormattedContent();

            endInfo.Paragraphs.Add(new PDFFormattedTextBlock(" ", headerFont));
            endInfo.Paragraphs.Add(new PDFFormattedTextBlock("PAID IN FULL by credit card.", headerFont));
            endInfo.Paragraphs.Add(new PDFFormattedTextBlock(" ", headerFont));

            PDFFormattedTextBlock text1 = new PDFFormattedTextBlock("If you have any queries regarding this Invoice, please contact ", contentFont);
            PDFFormattedTextBlock email = new PDFFormattedTextBlock("*****@*****.**", contentFont);
            PDFFormattedTextBlock text2 = new PDFFormattedTextBlock(" quoting the Invoice Number above.", contentFont);

            email.TextColor = new PDFBrush(PDFRgbColor.Blue);
            email.Action    = new PDFUriAction("mailto:[email protected]");
            endInfo.Paragraphs.Add(text1, email, text2);

            PDFFlowTextContent endInfoText = new PDFFlowTextContent(endInfo);

            return(endInfoText);
        }
コード例 #4
0
        private static PDFFlowContent BuildBuyerSection(PDFAnsiTrueTypeFont verdana, PDFAnsiTrueTypeFont verdanaBold)
        {
            PDFAnsiTrueTypeFont headerFont = new PDFAnsiTrueTypeFont(verdana);

            headerFont.Size = 20;
            PDFAnsiTrueTypeFont labelFont = new PDFAnsiTrueTypeFont(verdanaBold);

            labelFont.Size = 12;
            PDFAnsiTrueTypeFont contentFont = new PDFAnsiTrueTypeFont(verdana);

            contentFont.Size = 12;

            PDFFormattedContent buyerInfo = new PDFFormattedContent();

            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock(" ", headerFont));
            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock("Invoice to:", headerFont));
            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock(" ", headerFont));
            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock("Contoso LLC", contentFont));
            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock("1000 Summer Road", contentFont));
            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock("London", contentFont));
            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock("1A2 3B4", contentFont));
            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock("United Kingdom", contentFont));
            buyerInfo.Paragraphs.Add(" ");

            PDFFormattedTextBlock labelVAT = new PDFFormattedTextBlock("Your VAT/Tax number: ", labelFont);
            PDFFormattedTextBlock vat      = new PDFFormattedTextBlock("GB1234567890", contentFont);

            buyerInfo.Paragraphs.Add(labelVAT, vat);
            buyerInfo.Paragraphs.Add(new PDFFormattedTextBlock(" ", headerFont));

            PDFFlowTextContent buyerInfoText = new PDFFlowTextContent(buyerInfo);

            return(buyerInfoText);
        }
コード例 #5
0
        private static PDFFlowContent BuildSellerSection(PDFAnsiTrueTypeFont verdana, PDFAnsiTrueTypeFont verdanaBold)
        {
            PDFAnsiTrueTypeFont labelFont = new PDFAnsiTrueTypeFont(verdanaBold);

            labelFont.Size = 12;
            PDFAnsiTrueTypeFont contentFont = new PDFAnsiTrueTypeFont(verdana);

            contentFont.Size = 12;

            PDFFormattedContent sellerInfo = new PDFFormattedContent();

            sellerInfo.Paragraphs.Add(new PDFFormattedTextBlock("DemoCompany LLC", contentFont));
            sellerInfo.Paragraphs.Add(new PDFFormattedTextBlock("3000 Alandala Road", contentFont));
            sellerInfo.Paragraphs.Add(new PDFFormattedTextBlock("Beverly Hills", contentFont));
            sellerInfo.Paragraphs.Add(new PDFFormattedTextBlock("CA 90210", contentFont));
            sellerInfo.Paragraphs.Add(new PDFFormattedTextBlock("United States", contentFont));
            sellerInfo.Paragraphs.Add(" ");

            PDFFormattedTextBlock labelPhone = new PDFFormattedTextBlock("Phone: ", labelFont);
            PDFFormattedTextBlock phone      = new PDFFormattedTextBlock("+1-555-123-4567", contentFont);

            sellerInfo.Paragraphs.Add(labelPhone, phone);

            PDFFormattedTextBlock labelFax = new PDFFormattedTextBlock("Fax: ", labelFont);
            PDFFormattedTextBlock fax      = new PDFFormattedTextBlock("+1-555-456-7890", contentFont);

            sellerInfo.Paragraphs.Add(labelFax, fax);

            PDFFormattedTextBlock labelEmail = new PDFFormattedTextBlock("Email: ", labelFont);
            PDFFormattedTextBlock email      = new PDFFormattedTextBlock("*****@*****.**", contentFont);

            email.TextColor = new PDFBrush(PDFRgbColor.Blue);
            email.Action    = new PDFUriAction("mailto:[email protected]");
            sellerInfo.Paragraphs.Add(labelEmail, email);

            PDFFormattedTextBlock labelWeb = new PDFFormattedTextBlock("Web: ", labelFont);
            PDFFormattedTextBlock web      = new PDFFormattedTextBlock("www.o2sol.com", contentFont);

            web.TextColor = new PDFBrush(PDFRgbColor.Blue);
            web.Action    = new PDFUriAction("http://www.o2sol.com");
            sellerInfo.Paragraphs.Add(labelWeb, web);

            for (int i = 0; i < sellerInfo.Paragraphs.Count; i++)
            {
                sellerInfo.Paragraphs[i].HorizontalAlign = PDFStringHorizontalAlign.Right;
            }
            PDFFlowTextContent sellerInfoText = new PDFFlowTextContent(sellerInfo);

            return(sellerInfoText);
        }
コード例 #6
0
        private void CreateIntroPage(PDFFlowDocument document, PDFAnsiTrueTypeFont verdana, PDFAnsiTrueTypeFont verdanaBold)
        {
            PDFFormattedParagraph titleParagraph = new PDFFormattedParagraph("DOCUMENT INTRO PAGE");

            titleParagraph.SpacingBefore = 300;
            (titleParagraph.Blocks[0] as PDFFormattedTextBlock).Font      = new PDFAnsiTrueTypeFont(verdanaBold);
            (titleParagraph.Blocks[0] as PDFFormattedTextBlock).Font.Size = 36;
            titleParagraph.HorizontalAlign = PDFStringHorizontalAlign.Center;
            PDFFormattedParagraph subtitleParagraph = new PDFFormattedParagraph("no headers and footers");

            (subtitleParagraph.Blocks[0] as PDFFormattedTextBlock).Font      = new PDFAnsiTrueTypeFont(verdana);
            (subtitleParagraph.Blocks[0] as PDFFormattedTextBlock).Font.Size = 10;
            subtitleParagraph.HorizontalAlign = PDFStringHorizontalAlign.Center;

            PDFFormattedContent fc = new PDFFormattedContent();

            fc.Paragraphs.Add(titleParagraph);
            fc.Paragraphs.Add(subtitleParagraph);

            document.AddContent(new PDFFlowTextContent(fc));
        }
コード例 #7
0
ファイル: PDFUA.cs プロジェクト: o2solutions/pdf4net
        private static void FormattedContent(PDFFixedDocument document, PDFStructureElement seParent, PDFAnsiTrueTypeFont font)
        {
            string text1 = "Morbi pulvinar eros sit amet diam lacinia, ut feugiat ligula bibendum. Suspendisse ultrices cursus condimentum. " +
                           "Pellentesque semper iaculis luctus. Sed ac maximus urna. Aliquam erat volutpat. ";
            string text2 = "Vivamus vel sollicitudin dui. Aenean efficitur " +
                           "fringilla dui, at varius lacus luctus ac. Quisque tellus dui, lacinia non lectus nec, semper faucibus erat.";

            PDFAnsiTrueTypeFont headingFont = new PDFAnsiTrueTypeFont(font, 16);
            PDFAnsiTrueTypeFont textFont    = new PDFAnsiTrueTypeFont(font, 10);
            PDFBrush            blackBrush  = new PDFBrush(PDFRgbColor.Black);
            PDFPen  blackPen = new PDFPen(PDFRgbColor.Black, 1);
            PDFPage page     = document.Pages.Add();

            page.TabOrder = PDFPageTabOrder.Structure;

            PDFStructureElement seSection = new PDFStructureElement(PDFStandardStructureTypes.Section);

            seSection.Title = "Formatted content";
            seParent.AppendChild(seSection);

            PDFStructureElement seHeading = new PDFStructureElement(PDFStandardStructureTypes.Heading);

            seSection.AppendChild(seHeading);

            page.Graphics.BeginStructureElement(seHeading);
            page.Graphics.DrawString("Another heading", headingFont, blackBrush, 30, 50);
            page.Graphics.EndStructureElement();

            PDFFormattedContent fc = new PDFFormattedContent();

            PDFFormattedParagraph paragraph1 = new PDFFormattedParagraph(text1, textFont);

            paragraph1.LineSpacing      = 1.2;
            paragraph1.LineSpacingMode  = PDFFormattedParagraphLineSpacing.Multiple;
            paragraph1.StructureElement = new PDFStructureElement(PDFStandardStructureTypes.Paragraph);
            seSection.AppendChild(paragraph1.StructureElement);
            fc.Paragraphs.Add(paragraph1);

            PDFFormattedTextBlock block1 = new PDFFormattedTextBlock("Sample paragraph with a link.\r\n", textFont);

            block1.StructureElement = new PDFStructureElement(PDFStandardStructureTypes.Span);
            PDFFormattedTextBlock block2 = new PDFFormattedTextBlock("http://www.o2sol.com/\r\n", textFont);

            block2.TextColor        = new PDFBrush(PDFRgbColor.Blue);
            block2.Action           = new PDFUriAction("http://www.o2sol.com/");
            block2.StructureElement = new PDFStructureElement(PDFStandardStructureTypes.Link);
            PDFFormattedTextBlock block3 = new PDFFormattedTextBlock("http://www.pdf4net.com/", textFont);

            block3.TextColor        = new PDFBrush(PDFRgbColor.Blue);
            block3.Action           = new PDFUriAction("http://www.pdf4net.com/");
            block3.StructureElement = new PDFStructureElement(PDFStandardStructureTypes.Link);
            PDFFormattedParagraph paragraph2 = new PDFFormattedParagraph(block1, block2, block3);

            paragraph2.LineSpacing      = 1.2;
            paragraph2.LineSpacingMode  = PDFFormattedParagraphLineSpacing.Multiple;
            paragraph2.StructureElement = new PDFStructureElement(PDFStandardStructureTypes.Paragraph);
            // Do not mark the paragraph in the content stream, instead its blocks will be marked.
            paragraph2.StructureElement.GenerateMarkedContentSequence = false;
            paragraph2.StructureElement.AppendChild(block1.StructureElement);
            paragraph2.StructureElement.AppendChild(block2.StructureElement);
            paragraph2.StructureElement.AppendChild(block3.StructureElement);
            seSection.AppendChild(paragraph2.StructureElement);
            fc.Paragraphs.Add(paragraph2);

            PDFFormattedParagraph paragraph3 = new PDFFormattedParagraph(text2, textFont);

            paragraph3.LineSpacing      = 1.2;
            paragraph3.LineSpacingMode  = PDFFormattedParagraphLineSpacing.Multiple;
            paragraph3.StructureElement = new PDFStructureElement(PDFStandardStructureTypes.Paragraph);
            seSection.AppendChild(paragraph3.StructureElement);
            fc.Paragraphs.Add(paragraph3);

            page.Graphics.DrawFormattedContent(fc, 30, 70, 550, 0);
        }
コード例 #8
0
        private void CreateContentPage(PDFFlowDocument document, PDFAnsiTrueTypeFont verdana, int textIndex)
        {
            string[] text = new string[] {
                "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras commodo elementum odio, non venenatis risus efficitur a. " +
                "Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sit amet purus eget sem tristique faucibus. " +
                "Nam ut felis vel ex ullamcorper pretium at quis nisl. Nam ac lacus tincidunt, vulputate sapien vel, tempus sem. Aliquam vel ligula dui. " +
                "Vivamus porttitor nunc vitae mi interdum, vitae ullamcorper turpis bibendum. Vestibulum sagittis lorem ante, at tincidunt arcu suscipit eu. " +
                "Morbi augue eros, tristique a consectetur ac, egestas nec turpis. Praesent non purus quis sem consequat tempor sed ac augue. Integer at mauris ac ipsum bibendum aliquam vitae id mi. " +
                "Praesent efficitur tortor in ligula mattis scelerisque. Fusce in placerat augue. Mauris pretium, dui ac accumsan aliquet, justo sem posuere purus, " +
                "sit amet tristique mi tortor malesuada lorem. Sed congue sem a neque tristique tristique et a odio. Curabitur quis aliquam turpis, tincidunt ullamcorper velit. " +
                "Phasellus posuere, justo auctor convallis luctus, mi tortor interdum lorem, ac tempor nisi lorem in erat. Maecenas dapibus tristique lacus id egestas. " +
                "Vivamus id risus vitae velit porta lacinia. Aliquam erat volutpat. Nulla facilisi. Donec tempor arcu eu rhoncus fringilla.",
                "Vivamus ullamcorper ligula sit amet interdum imperdiet. Nulla facilisi. Suspendisse et euismod elit. Quisque vitae magna nunc. " +
                "Mauris condimentum at magna blandit semper. Pellentesque in lacus odio. Sed nec molestie lacus, eget scelerisque lorem. " +
                "Etiam rutrum tellus at auctor vehicula. Mauris consequat, tortor vitae finibus efficitur, tellus arcu feugiat leo, in condimentum elit felis ut risus. " +
                "Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce tincidunt libero sem, ut hendrerit turpis dapibus ut. " +
                "Donec lacinia luctus scelerisque. Sed vulputate egestas accumsan. Cras volutpat enim neque, malesuada varius lorem volutpat eget. Mauris lobortis risus ut leo malesuada, " +
                "in volutpat felis finibus. Proin a gravida velit. Ut lorem urna, sollicitudin sit amet nibh at, vestibulum pharetra mauris. Maecenas metus mi, dapibus in erat at, " +
                "congue tincidunt sapien. Vestibulum in pellentesque risus, id accumsan mauris. Donec non ex consequat, pretium ante at, suscipit lacus. Fusce ac consectetur erat. " +
                "Pellentesque maximus justo quis ante ornare condimentum. ",
                "Proin accumsan orci a nulla gravida tincidunt. Nulla et nisl eget diam rhoncus euismod. Maecenas tellus eros, semper vitae pharetra a, tincidunt ut dolor. " +
                "Nullam tempor at sapien vel efficitur. Duis vel aliquet felis, vitae tincidunt dolor. Sed tortor urna, dictum eu leo quis, feugiat eleifend ligula. Quisque vitae nisi venenatis, " +
                "pretium augue id, consequat velit. Sed dignissim justo velit, id faucibus leo scelerisque sed. In vestibulum blandit ipsum et rhoncus. Aliquam erat lorem, interdum vitae ligula at, " +
                "vulputate feugiat nunc. Fusce condimentum quis ligula ac dictum. Aliquam et viverra purus. Duis sollicitudin dolor eget diam pretium tempus. Nullam in magna eu tortor facilisis placerat non " +
                "vitae eros. Ut vitae magna dictum felis lacinia aliquam facilisis nec sem. ",
                "Suspendisse potenti. Vivamus maximus mi consequat lectus tincidunt consectetur. Proin vulputate velit lectus, eu lobortis quam lobortis congue. Sed gravida magna non " +
                "eleifend malesuada. Donec tincidunt lorem et semper dignissim. Fusce ut ex vestibulum urna lobortis aliquet in lobortis ex. Integer vehicula erat sed quam dictum varius id sed magna. " +
                "Cras maximus lacus est, ut elementum neque faucibus et. Praesent malesuada egestas scelerisque. Donec interdum ex maximus, auctor nisl non, ornare enim. " +
                "Nulla finibus quis felis non iaculis. Maecenas fringilla placerat enim non pellentesque. Proin justo orci, elementum ut porttitor in, scelerisque vel nisl. " +
                "Nam sit amet pellentesque justo, et molestie dolor. Cras ipsum justo, facilisis eget diam non, lacinia iaculis libero. Curabitur convallis, velit nec finibus mattis, " +
                "tellus erat elementum ligula, quis viverra quam sapien et enim. Morbi tempor fringilla mattis. ",
                "Aenean porttitor, augue pretium semper tincidunt, justo orci volutpat odio, malesuada convallis lacus lorem at nisi. Nulla at dolor tincidunt, tempor orci et, blandit metus. " +
                "Pellentesque malesuada augue et odio interdum, sit amet laoreet odio sagittis. Maecenas porttitor consectetur eros nec tempor. Morbi ut pharetra nunc. Phasellus non massa congue, varius tortor nec, " +
                "maximus massa. Cras erat mauris, pulvinar eu nibh ac, scelerisque maximus sem. Nam sed fringilla dolor, finibus tincidunt purus. Sed in dui ut enim interdum sagittis. Cras neque quam, " +
                "ultricies euismod dignissim sit amet, elementum eget eros. Donec in sem vel nunc vulputate pharetra.Fusce rhoncus turpis id turpis aliquet pharetra. Vivamus tristique eros lectus, eget venenatis nulla dictum et. " +
                "Vestibulum volutpat mi eu consequat blandit. Quisque ornare pellentesque tellus, in congue turpis viverra vel. Donec quis velit non nulla aliquet maximus. Maecenas ultricies nisi dui, non dapibus libero tincidunt ut. " +
                "Quisque vel interdum diam, ultricies aliquet nisi. Vivamus dui erat, tincidunt quis nibh et, aliquet ultricies erat. Nullam sit amet sodales nibh, a gravida diam. Fusce efficitur ultrices pellentesque. " +
                "Pellentesque a suscipit justo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam lectus tellus, semper ut vehicula vitae, ullamcorper id sem. " +
                "Cras quis ipsum et ligula rutrum dignissim at sit amet leo. Etiam ut tortor in velit feugiat commodo a ut nunc. Proin nec efficitur augue. Phasellus non erat non dolor bibendum viverra in ut nunc. " +
                "Maecenas et sollicitudin nisi, in imperdiet mi. Sed luctus quam felis, a efficitur eros pellentesque ut. Integer suscipit dignissim quam sit amet feugiat. Morbi in odio quis ligula ultrices convallis. " +
                "Duis a dui tristique, pulvinar tellus vel, tristique ex. Sed metus velit, ornare sit amet felis at, finibus gravida ante. Nunc felis massa, viverra eget pellentesque ac, sollicitudin non odio. " +
                "Aliquam dictum nulla mauris, finibus venenatis dolor suscipit at. Donec sagittis consequat diam, non varius dolor ullamcorper et. Proin dictum magna eget massa posuere tincidunt. " +
                "Vivamus ut libero vel diam maximus posuere sagittis maximus mauris. Donec luctus, diam in porttitor interdum, nibh elit ultricies sem, eu porta nulla sapien id nisi. Mauris odio odio, " +
                "mattis quis enim et, laoreet consequat ligula. Praesent feugiat lacus sagittis, laoreet massa sit amet, luctus ipsum. Suspendisse id malesuada velit. Etiam sit amet risus diam. " +
                "Vestibulum non ligula vitae nunc bibendum ornare id ut ante. Morbi at orci mollis, commodo dui et, bibendum augue. Curabitur nibh arcu, vulputate eu sollicitudin et, egestas sed dui. " +
                "Mauris ante enim, cursus et scelerisque eu, vestibulum et neque. Sed gravida ultricies ante sit amet efficitur. Cras est augue, auctor vel commodo sit amet, consectetur at quam. " +
                "Phasellus vulputate convallis neque, vitae bibendum mi rutrum in. Pellentesque pharetra ultricies urna, vitae semper nulla congue non. Praesent venenatis ullamcorper risus, non luctus purus. " +
                "Integer rutrum magna id pulvinar viverra. Aliquam et scelerisque turpis. Quisque sed nisl eu orci congue tempus nec in tellus. Nam eget magna lacus. Nunc eu sapien in velit ultrices tincidunt. " +
                "Curabitur purus libero, viverra non mollis non, hendrerit sit amet tellus. Maecenas congue ut lectus et gravida. Nam commodo lacus at leo sollicitudin gravida. " +
                "Nullam felis ante, dapibus a laoreet a, sagittis id dolor. Sed eget risus id eros faucibus aliquet. Sed rhoncus nibh quam, at congue massa convallis ac. Nullam lobortis ex mauris, " +
                "nec viverra lacus fringilla sed.Pellentesque at sapien quis lectus ultrices fringilla a eu dolor. Pellentesque imperdiet ipsum a odio laoreet vehicula. Aenean vestibulum in dolor non suscipit. " +
                "Curabitur sed felis non mi malesuada mattis quis quis est. Maecenas finibus dolor et libero semper, et posuere sem interdum. Aenean posuere eleifend sapien, ac bibendum lorem egestas id. " +
                "Integer vehicula, quam in laoreet feugiat, neque elit scelerisque dui, eget facilisis dui turpis vel sapien. "
            };

            PDFFormattedContent fc = new PDFFormattedContent(text[textIndex]);

            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font      = new PDFAnsiTrueTypeFont(verdana);
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font.Size = 10;

            document.StartNewPage();
            document.AddContent(new PDFFlowTextContent(fc));
        }
コード例 #9
0
        /// <summary>
        /// Main method for running the sample.
        /// </summary>
        public static SampleOutputInfo[] Run()
        {
            PDFStandardFont heading1Font = new PDFStandardFont(PDFStandardFontFace.HelveticaBold, 16);
            PDFStandardFont heading2Font = new PDFStandardFont(heading1Font);

            heading2Font.Size = 14;
            PDFStandardFont heading3Font = new PDFStandardFont(heading1Font);

            heading3Font.Size = 12;

            PDFFlowDocument doc = new PDFFlowDocument();

            // Add an intro page to the document.
            PDFFormattedContent fc = new PDFFormattedContent("DEMO DOCUMENT\r\nwith automatically generated\r\nTable of Contents");

            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font      = new PDFStandardFont(heading1Font);
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font.Size = 24;
            fc.Paragraphs[0].HorizontalAlign = PDFStringHorizontalAlign.Center;
            PDFFlowTextContent ftc = new PDFFlowTextContent(fc);

            doc.AddContent(ftc);
            doc.StartNewPage();

            // Enable/disable the autonumbering of document headings
            bool autoNumber = true;

            // Setup the flow document content.
            // Heading content objects are used for the generation of table of contents.
            fc = new PDFFormattedContent("Chapter One");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading1Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            PDFFlowHeadingContent fhc = new PDFFlowHeadingContent(fc);

            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            PDFFormattedParagraph fp = new PDFFormattedParagraph(text1);

            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Section One");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading2Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 2;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text2);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Module One");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading3Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 3;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text3);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Module Two");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading3Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 3;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text4);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Section Two");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading2Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 2;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text5);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Module Three");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading3Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 3;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text6);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Module Four");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading3Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 3;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text7);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Chapter Two");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading1Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text8);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Section Three");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading2Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 2;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text9);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Module Five");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading3Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 3;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text10);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Module Six");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading3Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 3;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text1);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Section Four");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading2Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 2;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text2);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Module Seven");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading3Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 3;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text3);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            fc = new PDFFormattedContent("Module Eight");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font = heading3Font;
            fc.Paragraphs[0].SpacingBefore = fc.Paragraphs[0].SpacingAfter = 12;
            fhc            = new PDFFlowHeadingContent(fc);
            fhc.Level      = 3;
            fhc.AutoNumber = autoNumber;
            doc.AddContent(fhc);

            fc = new PDFFormattedContent();
            fp = new PDFFormattedParagraph(text4);
            fp.HorizontalAlign = PDFStringHorizontalAlign.Justified;
            fp.FirstLineIndent = 18;
            fc.Paragraphs.Add(fp);
            ftc = new PDFFlowTextContent(fc);
            doc.AddContent(ftc);

            // Setup the document's table of contents.
            PDFFlowDocumentTOCSettings tocSettings = new PDFFlowDocumentTOCSettings();

            // Generate the table of contents as document outline.
            tocSettings.GenerateDocumentOutline = true;
            // Generate the table of contents as a separate page in the document.
            tocSettings.GenerateContentsPage = true;
            tocSettings.ContentsTextFont     = new PDFStandardFont(PDFStandardFontFace.Helvetica, 10);
            tocSettings.ContentsTextColor    = new PDFBrush(PDFRgbColor.Black);
            // Insert the TOC page at position 1 (after the first page of the document).
            tocSettings.ContentsPagePosition = 1;
            // Visually connect the TOC entries with the page numbers using dots
            tocSettings.ContentsEntryFiller = '.';
            // Create a title for the TOC
            fc = new PDFFormattedContent("TABLE OF CONTENTS");
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font      = new PDFStandardFont(heading1Font);
            (fc.Paragraphs[0].Blocks[0] as PDFFormattedTextBlock).Font.Size = 24;
            fc.Paragraphs[0].HorizontalAlign = PDFStringHorizontalAlign.Center;
            fc.Paragraphs[0].SpacingAfter    = 24;
            tocSettings.ContentsTitle        = new PDFFlowTextContent(fc);
            // Indent the entries in the TOC
            if (autoNumber)
            {
                tocSettings.ContentsHeadingIndent = 10;
            }
            doc.GenerateTableOfContents(tocSettings);

            SampleOutputInfo[] output = new SampleOutputInfo[] { new SampleOutputInfo(doc, "tableofcontents.pdf") };
            return(output);
        }
コード例 #10
0
        /// <summary>
        /// Main method for running the sample.
        /// </summary>
        public static SampleOutputInfo[] Run()
        {
            string pdf4netText          = "PDF4NET";
            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 pdf4netLinkBlock = new PDFFormattedTextBlock(pdf4netText);

            pdf4netLinkBlock.Font           = new PDFStandardFont(PDFStandardFontFace.HelveticaBold, 10);
            pdf4netLinkBlock.Font.Underline = true;
            pdf4netLinkBlock.TextColor      = new PDFBrush(PDFRgbColor.Blue);
            pdf4netLinkBlock.Action         = new PDFUriAction("http://www.o2sol.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(pdf4netLinkBlock);
            paragraph1.Blocks.Add(new PDFFormattedTextBlock(paragraph1Block2Text, textFont));
            paragraph1.Blocks.Add(pdf4netLinkBlock);
            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(pdf4netLinkBlock);
            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(pdf4netLinkBlock);
            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.Canvas.DrawFormattedContent(formattedContent, 50, 50, 500, 700);
            page.Canvas.CompressAndClose();

            SampleOutputInfo[] output = new SampleOutputInfo[] { new SampleOutputInfo(document, "formattedcontent.pdf") };
            return(output);
        }