[reportlab-users] PLATYPUS printing to Landscape page.

Robin Becker robin at reportlab.com
Wed Dec 6 12:47:50 EST 2006


george wrote:

> Thanks for the prompt response. However, you missed a point which I hid

> in the subject line.

>

> I'm using Platypus as illustrated in paragraph 5.2 of userguide.pdf.

> There I don't have control of canvas. I would like the whole document

> to be printed Landscape.

>


George you can pass a canvasmaker argument into the SimpleDocTemplate build
method call or just set the document.pagesize as landscape(LETTER) or
landscape(A4) before calling build

eg

def go():
doc = SimpleDocTemplate("phello.pdf")
Story = [Spacer(1,2*inch)]
style = styles["Normal"]
for i in range(100):
bogustext = ("This is Paragraph number %s. " % i) *20
p = Paragraph(bogustext, style)
Story.append(p)
Story.append(Spacer(1,0.2*inch))
from reportlab.lib.pagesizes import A4, LETTER, landscape, portrait
doc.pagesize = landscape(A4)
doc.build(Story, onFirstPage=myFirstPage, onLaterPages=myLaterPages)


> Tim Roberts wrote:

>

>> george wrote:

>>

>>

>>> How does one write to a Landscape format document, 11 inch wide by 8.5

>>> inch high page size?

>>>

>>>

>>

>> from reportlab.lib.pagesizes import LETTER, landscape, portrait

>> ...

>> canv = canvas.Canvas( 'filename.pdf', pagesize=landscape(LETTER) )

>>

>>

>>

>

>

> ------------------------------------------------------------------------

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users



--
Robin Becker


More information about the reportlab-users mailing list