#coding=utf-8
def init_config():
import reportlab.rl_config
reportlab.rl_config.warnOnMissingFontGlyphs = 0
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import copy
pdfmetrics.registerFont(TTFont('zhenhei', 'D:/python_workspace/python_pdf_demo/wqy-zenhei.ttc'))
stylesheet= getSampleStyleSheet()
styles= copy.deepcopy(stylesheet['Normal'])
styles.fontName ='zhenhei'
styles.fontSize = 20
return styles
from reportlab.platypus import *
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.rl_config import defaultPageSize
from reportlab.lib.units import inch
from reportlab.lib.pagesizes import *
#from reportlab.lib.utils import *
from reportlab.lib.units import mm
styles=init_config()
PAGE_HEIGHT=defaultPageSize[1] <
python reportlab调用操作分页报表
最新推荐文章于 2024-07-22 16:46:28 发布