DynamicPDF by ceTe Software

com.cete.dynamicpdf
Class PageDimensions

java.lang.Object
  extended by com.cete.dynamicpdf.AreaDimensions
      extended by com.cete.dynamicpdf.PageDimensions
Direct Known Subclasses:
AutoPageDimensions, ExtendedPageDimensions

public class PageDimensions
extends AreaDimensions

This class can be used to specify the dimensions and other formatting details of a page. It can then be passed into a Page constructor.

Licensing:
This class is a DynamicPDF Generator Community Edition feature.

View Example


Constructor Summary
PageDimensions(Dimensions edgeDimensions)
          Initializes a new instance of the PageDimensions class.
PageDimensions(Dimensions edgeDimensions, Dimensions marginDimensions)
          Initializes a new instance of the PageDimensions class.
PageDimensions(Dimensions edgeDimensions, float margins)
          Initializes a new instance of the PageDimensions class.
PageDimensions(float width, float height)
          Initializes a new instance of the PageDimensions class.
PageDimensions(float width, float height, float margins)
          Initializes a new instance of the PageDimensions class.
PageDimensions(PageSize size)
          Initializes a new instance of the PageDimensions class.
PageDimensions(PageSize size, float margins)
          Initializes a new instance of the PageDimensions class.
PageDimensions(PageSize size, PageOrientation orientation)
          Initializes a new instance of the PageDimensions class.
PageDimensions(PageSize size, PageOrientation orientation, float margins)
          Initializes a new instance of the PageDimensions class.
 
Method Summary
 void draw(DocumentWriter writer)
          Draws the page dimensions to the given DocumentWriter object.
 InheritableDimensions getArtBox()
          Gets the art box dimensions of the page in points (1/72 inches).
 InheritableDimensions getBleedBox()
          Gets the bleed box dimensions of the page in points (1/72 inches).
 InheritableDimensions getCropBox()
          Gets the crop box dimensions of the page in points (1/72 inches).
 Dimensions getMediaBox()
          Gets the media box dimensions of the page in points (1/72 inches).
 float getPdfY(float y)
          Gets the translated Y coordinate.
 float getPdfY(float y, RelativeTo relativeTo, boolean ignoreMargins)
          Gets the translated Y coordinate.
 InheritableDimensions getTrimBox()
          Gets the trim box dimensions of the page in points (1/72 inches).
 void setMargins(float margins)
          Sets all of the margins for the page dimensions.
 void setMargins(float leftAndRight, float topAndBottom)
          Sets all of the margins of the page.
 void setMargins(float leftMargin, float topMargin, float rightMargin, float bottomMargin)
          Sets all of the margins of the page.
 
Methods inherited from class com.cete.dynamicpdf.AreaDimensions
getBody, getBottomMargin, getEdge, getHeight, getLeftMargin, getPdfX, getPdfX, getRightMargin, getTopMargin, getWidth, setBottomMargin, setHeight, setLeftMargin, setRightMargin, setTopMargin, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageDimensions

public PageDimensions(float width,
                      float height)
Initializes a new instance of the PageDimensions class.

Parameters:
width - Width of the page dimensions.
height - Height of the page dimensions.
See Also:
PageDimensions

PageDimensions

public PageDimensions(float width,
                      float height,
                      float margins)
Initializes a new instance of the PageDimensions class.

Parameters:
width - Width of the page dimensions.
height - Height of the page dimensions.
margins - Margins of the page dimensions.
See Also:
PageDimensions

PageDimensions

public PageDimensions(PageSize size)
Initializes a new instance of the PageDimensions class.

Parameters:
size - Page size of the page dimensions.
See Also:
PageDimensions

PageDimensions

public PageDimensions(PageSize size,
                      PageOrientation orientation)
Initializes a new instance of the PageDimensions class.

Parameters:
size - Page size of the page dimensions.
orientation - Orientation of the page dimensions.
See Also:
PageDimensions

PageDimensions

public PageDimensions(PageSize size,
                      float margins)
Initializes a new instance of the PageDimensions class.

Parameters:
size - Page size of the page dimensions.
margins - Margins of the page dimensions.
See Also:
PageDimensions

PageDimensions

public PageDimensions(PageSize size,
                      PageOrientation orientation,
                      float margins)
Initializes a new instance of the PageDimensions class.

Parameters:
size - Page size of the page dimensions.
orientation - Orientation of the page dimensions.
margins - Margins of the page dimensions.
See Also:
PageDimensions

PageDimensions

public PageDimensions(Dimensions edgeDimensions)
Initializes a new instance of the PageDimensions class.

Parameters:
edgeDimensions - Edge dimensions of the page dimensions.
See Also:
PageDimensions

PageDimensions

public PageDimensions(Dimensions edgeDimensions,
                      float margins)
Initializes a new instance of the PageDimensions class.

Parameters:
edgeDimensions - Edge dimensions of the page dimensions.
margins - Margins of the page dimensions.
See Also:
PageDimensions

PageDimensions

public PageDimensions(Dimensions edgeDimensions,
                      Dimensions marginDimensions)
Initializes a new instance of the PageDimensions class.

Parameters:
edgeDimensions - Edge dimensions of the page dimensions.
marginDimensions - Margin dimensions of the page dimensions.
See Also:
PageDimensions
Method Detail

getMediaBox

public Dimensions getMediaBox()
Gets the media box dimensions of the page in points (1/72 inches).

Returns:
media box dimensions of the page in points (1/72 inches).

getCropBox

public InheritableDimensions getCropBox()
Gets the crop box dimensions of the page in points (1/72 inches).

Returns:
crop box dimensions of the page in points (1/72 inches).

getBleedBox

public InheritableDimensions getBleedBox()
Gets the bleed box dimensions of the page in points (1/72 inches).

Returns:
bleed box dimensions of the page in points (1/72 inches).

getTrimBox

public InheritableDimensions getTrimBox()
Gets the trim box dimensions of the page in points (1/72 inches).

Returns:
trim box dimensions of the page in points (1/72 inches).

getArtBox

public InheritableDimensions getArtBox()
Gets the art box dimensions of the page in points (1/72 inches).

Returns:
art box dimensions of the page in points (1/72 inches).

draw

public void draw(DocumentWriter writer)
Draws the page dimensions to the given DocumentWriter object.

Throws:
java.lang.IllegalArgumentException - Left and top edge of page must be 0.
Parameters:
writer - to receive the page dimensions output.
See Also:
DocumentWriter

getPdfY

public float getPdfY(float y)
Gets the translated Y coordinate.

Overrides:
getPdfY in class AreaDimensions
Parameters:
y - Y coordinate to translate.
Returns:
A translated Y coordinate.

getPdfY

public float getPdfY(float y,
                     RelativeTo relativeTo,
                     boolean ignoreMargins)
Gets the translated Y coordinate.

Overrides:
getPdfY in class AreaDimensions
Parameters:
y - Y coordinate to translate.
relativeTo - Placement of the page element on the page.
ignoreMargins - Setting false will consider the margin while placing the page element based on the RelativeTo property.
Returns:
A translated Y coordinate.

setMargins

public void setMargins(float margins)
Sets all of the margins for the page dimensions.

Parameters:
margins - Margins value to set.

setMargins

public void setMargins(float leftAndRight,
                       float topAndBottom)
Sets all of the margins of the page.

Parameters:
leftAndRight - Left and right margin value to set.
topAndBottom - Top and bottom margin value to set.

setMargins

public void setMargins(float leftMargin,
                       float topMargin,
                       float rightMargin,
                       float bottomMargin)
Sets all of the margins of the page.

Parameters:
leftMargin - Left margin value to set.
topMargin - Top margin value to set.
rightMargin - Right margin value to set.
bottomMargin - Bottom margin value to set.

DynamicPDF by ceTe Software

API Reference for DynamicPDF v11.02 for Java generated on Sep 02, 2021
© Copyright 2021, ceTe Software