'Method to set the margins of the document
@param left: the size of the left margin, default None
@param right: the size of the right margin, default None
@param top: the size of the top margin, default None
@param bottom: the size of the bottom margin, default None
The margin is only changed if a value is provided, otherwise the
last value that was set will be used. The original values are set
up to be an inch - in newDocument()
@todo: make this for a page rather than the document'

def setMargins(self, left=None, right=None, top=None, bottom=None):

    if (left != None):
        self.doc.leftMargin = left
        self.leftMargin = left
    else:
        self.doc.leftMargin = self.leftMargin
    if (right != None):
        self.doc.rightMargin = right
        self.rightMargin = right
    else:
        self.doc.rightMargin = self.rightMargin
    if (top != None):
        self.doc.topMargin = top
        self.topMargin = top
    else:
        self.doc.topMargin = self.topMargin
    if (bottom != None):
        self.doc.bottomMargin = bottom
        self.bottomMargin = bottom
    else:
        self.doc.bottomMargin = self.bottomMargin
