Then, we can call the showPage method again to create a third page. Any content you create afterward will be added to the next page. One way to tell ReportLab the content on a single page is finished is to use the showPage method, like below. To handle creating multiple pages, we’ll modify the above example to create a PDF with three separate pages. This is a common and useful task to be able to do. Next, let’s show how to create a PDF with multiple pages. Report.drawString(50, 800, "**Test PDF with Different Font**") Report = canvas.Canvas("test_with_font.pdf") To adjust font types, we can tweak our first ReportLab example above to use the setFont method. Generalizing on our code above, we can add a few paragraphs of text, followed by a sample image.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |