Shows how to create headers and footers in a document using DocumentBuilder. Call the builder's "EndRow" method to start a new row.ĭoc.save(getArtifactsDir() + "") Start the table, then populate the first row with two cells. Shows how to use a document builder to create a table.ĭocumentBuilder builder = new DocumentBuilder(doc) Note that getFont(), getParagraphFormat() and getPageSetup() properties are updated whenever you navigate to a different place in the document to reflect formatting properties available at the new location. User the insertCell() and endRow() methods to build a table. Use the getCellFormat() and getRowFormat() properties to specify formatting properties for table cells and rows. Use the getPageSetup() property to specify page and section properties for the current section and all section that will be inserted. Use the getParagraphFormat() property to specify paragraph formatting for the current and all paragraphs that will be inserted. Use the getFont() property to specify character formatting that will apply to all text inserted from the current position in the document onwards. You can navigate the DocumentBuilder cursor to a different location in a document using various MoveToXXX methods. The DocumentBuilder has an internal cursor where the text will be inserted when you call write(), writeln(), M:() and other methods. DocumentBuilder is a “facade” for the complex structure of Document and allows to insert content and formatting quickly and easily.Ĭreate a DocumentBuilder and associate it with a Document. Document is a composite object consisting of a tree of nodes and while inserting content nodes directly into the tree is possible, it requires good understanding of the tree structure. To learn more, visit the Document Builder Overview documentation article.ĭocumentBuilder makes the process of building a Document easier. Provides methods to insert text, images and other content, specify font, paragraph and section formatting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |