How to set a pdf background color? [closed]

泪湿孤枕 提交于 2020-01-07 09:58:30

问题


I want to generate a p d f with report lab. I need to change the background color of the exported p d f ( not FONT color, BACKGROUND color ). Thanks!


回答1:


from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4


c=canvas.Canvas("Background",pagesize=A4)
c.setFillColorRGB(1,0,0)
c.rect(5,5,652,792,fill=1)
c.setTitle("Background")
c.showPage()
c.save()


来源:https://stackoverflow.com/questions/57412087/how-to-set-a-pdf-background-color

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!