'Set the page footer caption and optional margin.
Args:
footer:  Footer string.
margin:  Footer margin.
options: Footer options, mainly for images.
Returns:
Nothing.'

def set_footer(self, footer='', options=None, margin=None):

    footer_orig = footer
    footer = footer.replace('&[Picture]', '&G')
    if (len(footer) >= 255):
        warn('Footer    string    must    be    less    than    255    characters')
        return
    if (options is not None):
        if (not isinstance(options, dict)):
            options = {'margin': options}
    else:
        options = {}
    if (margin is not None):
        options['margin'] = margin
    self.footer_images = []
    if options.get('image_left'):
        self.footer_images.append([options.get('image_left'), options.get('image_data_left'), 'LF'])
    if options.get('image_center'):
        self.footer_images.append([options.get('image_center'), options.get('image_data_center'), 'CF'])
    if options.get('image_right'):
        self.footer_images.append([options.get('image_right'), options.get('image_data_right'), 'RF'])
    placeholder_count = footer.count('&G')
    image_count = len(self.footer_images)
    if (placeholder_count != image_count):
        warn(("Number    of    footer    images    (%s)    doesn't    match    placeholder    count    (%s)    in    string:    %s" % (image_count, placeholder_count, footer_orig)))
        self.footer_images = []
        return
    if ('align_with_margins' in options):
        self.header_footer_aligns = options['align_with_margins']
    if ('scale_with_doc' in options):
        self.header_footer_scales = options['scale_with_doc']
    self.footer = footer
    self.margin_footer = options.get('margin', 0.3)
    self.header_footer_changed = True
    if image_count:
        self.has_header_vml = True
