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:
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.
 float getPdfY(float y)
          Gets the translated Y coordinate.
 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, 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

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.

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 v10.07 for Java generated on Aug 12, 2020
© Copyright 2020, ceTe Software