Aspose.Pdf.Examples.CSharp.AsposePDF.Text.AddText.AddTextUsingTextParagraph C# (CSharp) 메소드

AddTextUsingTextParagraph() 공개 정적인 메소드

public static AddTextUsingTextParagraph ( ) : void
리턴 void
        public static void AddTextUsingTextParagraph()
        {
            // ExStart:AddTextUsingTextParagraph
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_Text();
            // Open document
            Document doc = new Document();
            // Add page to pages collection of Document object
            Page page = doc.Pages.Add();
            TextBuilder builder = new TextBuilder(page);
            // Create text paragraph
            TextParagraph paragraph = new TextParagraph();
            // Set subsequent lines indent
            paragraph.SubsequentLinesIndent = 20;
            // Specify the location to add TextParagraph
            paragraph.Rectangle = new Aspose.Pdf.Rectangle(100, 300, 200, 700);
            // Specify word wraping mode
            paragraph.FormattingOptions.WrapMode = TextFormattingOptions.WordWrapMode.ByWords;
            // Create text fragment
            TextFragment fragment1 = new TextFragment("the quick brown fox jumps over the lazy dog");
            fragment1.TextState.Font = FontRepository.FindFont("Times New Roman");
            fragment1.TextState.FontSize = 12;
            // Add fragment to paragraph
            paragraph.AppendLine(fragment1);
            // Add paragraph
            builder.AppendParagraph(paragraph);

            dataDir = dataDir + "AddTextUsingTextParagraph_out.pdf";

            // Save resulting PDF document.
            doc.Save(dataDir);
            
            // ExEnd:AddTextUsingTextParagraph
            Console.WriteLine("\nText using text paragraph added successfully.\nFile saved at " + dataDir);
        }
        public static void AddHyperlinkToTextSegment()