from reportlab.lib.pagesizes import A4
from reportlab.platypus import BaseDocTemplate,PageTemplate, Frame
doc = BaseDocTemplate("pdf_file",showBoundary=1,leftMargin=0,rightMargin=0,topMargin=10,bottomMargin=10,pagesize=A4)
frameT = Frame(self.doc.leftMargin,self.doc.bottomMargin,self.doc.width,self.doc.height,topPadding=0,id='normal')
time = Paragraph('16:37',self.styles["normal"])
doc.build([time])
通过topMargin、bottomMargin、leftMargin、rightMargin 设置页面边距