Next / Previous / Contents / Shipman's homepage

4.5. class MarginSet: Four margin dimensions

The purpose of this class is to represent the four margin sizes of a page master. The constructor:

MarginSet(top=T, bot=B, left=L, right=R)

Each argument defines the width or height of one margin. Each argument defaults to zero. The values supplied for each argument may be either an instance of class FoDim or a string that is acceptable as an XSL-FO dimension, e.g., "3.6pc".

Instances of MarginSet have these attributes and methods:

.top

The top margin height.

.bot

The bottom margin height.

.left

The left margin width.

.right

The right margin width.

.dict()

Return the instance's dimensions as a dictionary with keys margin-top, margin-bottom, margin-left, and margin-right, suitable for describing the margin properties of several kinds of areas that share the “box properties” group.