Module BaseDoc :: Class PaperStyle
[frames] | no frames]

Class PaperStyle

source code

Define the various options for a sheet of paper.

Instance Methods
 
__init__(self, size, orientation, lmargin=2.54, rmargin=2.54, tmargin=2.54, bmargin=2.54)
Create a new paper style.
source code
PaperSize
get_size(self)
Return the size of the paper.
source code
int
get_orientation(self)
Return the orientation of the page.
source code
 
get_usable_width(self)
Return the width of the page area in centimeters.
source code
 
get_usable_height(self)
Return the height of the page area in centimeters.
source code
float
get_right_margin(self)
Return the right margin.
source code
float
get_left_margin(self)
Return the left margin.
source code
float
get_top_margin(self)
Return the top margin.
source code
float
get_bottom_margin(self)
Return the bottom margin.
source code
Method Details

__init__(self, size, orientation, lmargin=2.54, rmargin=2.54, tmargin=2.54, bmargin=2.54)
(Constructor)

source code 

Create a new paper style.

Parameters:
  • size (PaperSize) - size of the new style
  • orientation (PAPER_PORTRAIT or PAPER_LANDSCAPE) - page orientation

get_size(self)

source code 

Return the size of the paper.

Returns: PaperSize
object indicating the paper size

get_orientation(self)

source code 

Return the orientation of the page.

Returns: int
PAPER_PORTRIAT or PAPER_LANDSCAPE

get_usable_width(self)

source code 

Return the width of the page area in centimeters.

The value is the page width less the margins.

get_usable_height(self)

source code 

Return the height of the page area in centimeters.

The value is the page height less the margins.

get_right_margin(self)

source code 

Return the right margin.

Returns: float
Right margin in centimeters

get_left_margin(self)

source code 

Return the left margin.

Returns: float
Left margin in centimeters

get_top_margin(self)

source code 

Return the top margin.

Returns: float
Top margin in centimeters

get_bottom_margin(self)

source code 

Return the bottom margin.

Returns: float
Bottom margin in centimeters