public class

FlowDocument

extends Object
implements AutoCloseable
java.lang.Object
   ↳ com.pdftron.layout.FlowDocument

Class Overview

The class FlowDocument. Encapsulates document creation API.

Summary

Public Constructors
FlowDocument()
Public Methods
List addList()
Adds a list to the document.
Paragraph addParagraph()
Adds a paragraph to the document.
Paragraph addParagraph(String text)
Adds a paragraph to the document and sets the text.
Table addTable()
Adds a table to the document.
void close()
Frees the native memory of the object.
void destroy()
Frees the native memory of the object.
ContentNode getBody()
Gets the body of the document.
PDFDoc paginateToPDF()
Paginates the content tree into a PDFDoc object.
void setDefaultMargins(double leftPoints, double topPoints, double rightPoints, double bottomPoints)
Set the default margins for the document.
void setDefaultPageSize(double widthPoints, double heightPoints)
Set the default page size for the document.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.AutoCloseable

Public Constructors

public FlowDocument ()

Public Methods

public List addList ()

Adds a list to the document.

Returns
  • The list object

public Paragraph addParagraph ()

Adds a paragraph to the document.

Returns
  • The paragraph object

public Paragraph addParagraph (String text)

Adds a paragraph to the document and sets the text.

Returns
  • The paragraph object

public Table addTable ()

Adds a table to the document.

Returns
  • The table object

public void close ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

public void destroy ()

Frees the native memory of the object. This can be explicitly called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

public ContentNode getBody ()

Gets the body of the document.

The body is the root of the content tree. It can be used to traverse the content tree via the ContentNodeIterator object.

Returns
  • The body of the document

public PDFDoc paginateToPDF ()

Paginates the content tree into a PDFDoc object.

Returns
  • The PDFDoc object

public void setDefaultMargins (double leftPoints, double topPoints, double rightPoints, double bottomPoints)

Set the default margins for the document.

Parameters
leftPoints The left margin in points
topPoints The top margin in points
rightPoints The right margin in points
bottomPoints The bottom margin in points

public void setDefaultPageSize (double widthPoints, double heightPoints)

Set the default page size for the document.

Parameters
widthPoints The width in points
heightPoints The height in points