ReportLab中未编号的页面 [英] Non-numbered pages in ReportLab

查看:105
本文介绍了ReportLab中未编号的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过ReportLab生成PDF文件,以使Platypus进行的页码编排中不包括首页(可能还有目录)?

Is it possible to generate a PDF file using ReportLab in such a way that the front page (and possibly table of contents) are excluded from the page numbering done by Platypus?

推荐答案

是. 用户指南的第5章中的第一个示例,SimpleDocTemplate具有两个钩子:

Yes. The first example on chapter 5 of the user guide, SimpleDocTemplate has two hooks:

doc.build(Story, onFirstPage=myFirstPage, onLaterPages=myLaterPages)

只需更改myLaterPages定义即可有条件地打印页码.

Just change myLaterPages definition to conditionally print the page number.

这篇关于ReportLab中未编号的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆