简体   繁体   中英

Controlling the content of multiple frames in a pdf BaseDocTemplate (reportLab, python)

I am trying to control the content of each one of multiple frames in a BaseDocTemplate, but as far as I have seen it, the "build" method in the BaseDocTemplate class takes the flowables list and automatically decides which element goes in what frame. How can I control what element should go in which frame? Thank you.

After going over few blogs and trying with the code the best suitable solutions that was found is to use FrameBreak() method. So, while building the flowables story list (aka element list) we can append the FrameBreak() method to jump to the next Frame in the page template.

example:
... #Frames, pageTemplates, etc
story = [flowable_01, ... flowable_y, ***FrameBreak()***, flowable_n]
DocTemplate.build(story)

Where flowable_n should appear on the next Frame in the same page (if any left in the page) or in the later page (if defined).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM