Summary: Ctors | Methods | Inherited Methods | [Expand All]
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
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface java.lang.AutoCloseable
abstract void | close()

## Public Constructors

#### public FlowDocument ()

##### Throws

PDFNetException |

## Public Methods

#### public List addList ()

Adds a list to the document.

##### Returns

- The list object

##### Throws

PDFNetException |

#### public Paragraph addParagraph ()

Adds a paragraph to the document.

##### Returns

- The paragraph object

##### Throws

PDFNetException |

#### public Paragraph addParagraph (String text)

Adds a paragraph to the document and sets the text.

##### Returns

- The paragraph object

##### Throws

PDFNetException |

#### public Table addTable ()

Adds a table to the document.

##### Returns

- The table object

##### Throws

PDFNetException |

#### 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.

##### Throws

PDFNetException |

#### 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.

##### Throws

PDFNetException |

#### 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

##### Throws

PDFNetException |

#### public PDFDoc paginateToPDF ()

Paginates the content tree into a PDFDoc object.

##### Returns

- The PDFDoc object

##### Throws

PDFNetException |

#### 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

##### Throws

PDFNetException |

#### 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

##### Throws

PDFNetException |