예제 #1
0
def lastCover(pdf):
  ''' Layout for the last page '''
  pdf.padding(left=0,right=0,bottom=0,top=0)
  pdf.color('#e6eeee')


##### DOCUMENT #####

# output file
output = 'pdf/'+__file__[:-3]+'.pdf'

# initialize PDF
pdf = Document(output, title='Example')

# create your own elements styles
h1    = pdf._text(font='Helvetica-Bold', size=20, color='#17365d')
p     = pdf._text(font='Times-Roman')
pre   = pdf._text(font='Courier',preformatted=True)
tbl   = pdf._table()
img   = pdf._image()

# start page applying a specific layout "firstCover"
pdf.page(layout=firstCover)

# change padding for next pages by setting all to 40 points
pdf.padding(left=20,right=20,top=20,bottom=20)

# start a page with :
#- no layout set
#- a background color #e6eeee
#- keeping the previous padding above: left = right = top = bottom = 40