TextBuilder.AppendParagraph
Contents
[
Hide
]TextBuilder.AppendParagraph method
Appends text paragraph to Pdf page.
public void AppendParagraph(TextParagraph textParagraph)
Parameter | Type | Description |
---|---|---|
textParagraph | TextParagraph | Text paragraph object. |
Examples
The example demonstrates how to create text paragraph object and append it to the Pdf page.
Document doc = new Document(inFile);
Page page = (Page)doc.Pages[1];
// create text paragraph
TextParagraph paragraph = new TextParagraph();
// set the paragraph rectangle
paragraph.Rectangle = new Rectangle(100, 600, 200, 700);
// set word wrapping options
paragraph.FormattingOptions.WrapMode = TextFormattingOptions.WordWrapMode.ByWords;
// append string lines
paragraph.AppendLine("the quick brown fox jumps over the lazy dog");
paragraph.AppendLine("line2");
paragraph.AppendLine("line3");
// append the paragraph to the Pdf page with the TextBuilder
TextBuilder textBuilder = new TextBuilder(page);
textBuilder.AppendParagraph(paragraph);
// save Pdf document
doc.Save(outFile);
See Also
- class TextParagraph
- class TextBuilder
- namespace Aspose.Pdf.Text
- assembly Aspose.PDF