问题
I am using ReportLab for generating a PDF report. I've used SimpleDocTemplate and set pageSize = A5. but after bulding the PDF, when i open created file, the size of page is A4.
doc = SimpleDocTemplate(file_name, pageSize = A5)
doc.build(report)
I tried other page size but the created file size doesn't change and remain A4! what should i do?
回答1:
My Problem solved! I had just used landscape or portrait setting in additional to page size and its work!
doc = SimpleDocTemplate(file_name)
doc.pagesize = portrait(A5)
doc.build(report)
回答2:
But where from do you import portrait() method and A5 value?
来源:https://stackoverflow.com/questions/13776672/pagesize-doesnt-work-in-reportlab-simpledoctemplate