public class

Section

extends ContentContainer
java.lang.Object
   ↳ com.pdftron.layout.ContentElement
     ↳ com.pdftron.layout.ContentNode
       ↳ com.pdftron.layout.ContentContainer
         ↳ com.pdftron.layout.Section

Class Overview

A Section is a part of a document with its own page setup and its own headers and footers.

A document always has at least one section. Adding a section starts the content on a new page.

A section is a content container: paragraphs, tables and lists can be added to it directly.

Summary

Nested Classes
enum Section.PageGroup The group of pages a header or a footer applies to. 
Public Methods
double getBottomMargin()
ContentContainer getFooter(Section.PageGroup pages)
Gets the footer of the section for the given group of pages.
ContentContainer getHeader(Section.PageGroup pages)
Gets the header of the section for the given group of pages.
double getLeftMargin()
ContentContainer getOrCreateFooter(Section.PageGroup pages)
Gets the footer of the section for the given group of pages, creating it if the section does not have one yet.
ContentContainer getOrCreateHeader(Section.PageGroup pages)
Gets the header of the section for the given group of pages, creating it if the section does not have one yet.
double getPageHeight()
double getPageWidth()
double getRightMargin()
double getTopMargin()
void removeFooter(Section.PageGroup pages)
Removes the footer of the section for the given group of pages.
void removeHeader(Section.PageGroup pages)
Removes the header of the section for the given group of pages.
void setMargins(double leftPoints, double topPoints, double rightPoints, double bottomPoints)
Sets the margins of the section, overriding the document defaults.
void setPageSize(double widthPoints, double heightPoints)
Sets the page size of the section, overriding the document default.
[Expand]
Inherited Methods
From class com.pdftron.layout.ContentContainer
From class com.pdftron.layout.ContentNode
From class com.pdftron.layout.ContentElement
From class java.lang.Object

Public Methods

public double getBottomMargin ()

Returns
  • The bottom margin of the section in points

public ContentContainer getFooter (Section.PageGroup pages)

Gets the footer of the section for the given group of pages.

Parameters
pages The group of pages the footer applies to
Returns
  • The footer, or null if the section has no such footer

public ContentContainer getHeader (Section.PageGroup pages)

Gets the header of the section for the given group of pages.

Parameters
pages The group of pages the header applies to
Returns
  • The header, or null if the section has no such header

public double getLeftMargin ()

Returns
  • The left margin of the section in points

public ContentContainer getOrCreateFooter (Section.PageGroup pages)

Gets the footer of the section for the given group of pages, creating it if the section does not have one yet.

Parameters
pages The group of pages the footer applies to
Returns
  • The footer

public ContentContainer getOrCreateHeader (Section.PageGroup pages)

Gets the header of the section for the given group of pages, creating it if the section does not have one yet.

Parameters
pages The group of pages the header applies to
Returns
  • The header

public double getPageHeight ()

Returns
  • The page height of the section in points

public double getPageWidth ()

Returns
  • The page width of the section in points

public double getRightMargin ()

Returns
  • The right margin of the section in points

public double getTopMargin ()

Returns
  • The top margin of the section in points

public void removeFooter (Section.PageGroup pages)

Removes the footer of the section for the given group of pages.

Parameters
pages The group of pages the footer applies to

public void removeHeader (Section.PageGroup pages)

Removes the header of the section for the given group of pages.

Parameters
pages The group of pages the header applies to

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

Sets the margins of the section, overriding the document defaults.

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 setPageSize (double widthPoints, double heightPoints)

Sets the page size of the section, overriding the document default.

Parameters
widthPoints The width in points
heightPoints The height in points