[reportlab-users] Changeing page orientation of canvas.
Ian Sparks
reportlab-users@reportlab.com
Mon, 4 Nov 2002 08:29:12 -0500
Thanks Doug, exactly what I was looking for.
-----Original Message-----
From: Doug [mailto:doug@pennatus.com]
Sent: Friday, November 01, 2002 10:59 PM
To: reportlab-users@reportlab.com
Subject: RE: [reportlab-users] Changeing page orientation of canvas.
Hi Ian:
Is this what you are looking for?
# Reportlab imports
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch, cm
from reportlab.lib.pagesizes import A4,letter
from reportlab.lib import colors
c =3D canvas.Canvas("hello.pdf",pagesize=3Dletter)
c.drawString(0.3*inch,0.3*inch,'Hello world')
c.showPage()
c.setPageSize((100,100))
c.drawString(0.3*inch,0.3*inch,'Blargh Yack!')
c.showPage()
c.save()
-----Original Message-----
From: reportlab-users-admin@reportlab.com
[mailto:reportlab-users-admin@reportlab.com]On Behalf Of Ian Sparks
Sent: Friday, November 01, 2002 5:20 PM
To: reportlab-users@reportlab.com
Subject: RE: [reportlab-users] Changeing page orientation of canvas.
Ok, the same code with an _.
No discernable difference. Perhaps you could try this code jerome and =
see what you get?
# Reportlab imports
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch, cm
from reportlab.lib.pagesizes import A4,letter
from reportlab.lib import colors
c =3D canvas.Canvas("hello.pdf",pagesize=3Dletter)
c.drawString(0.3*inch,0.3*inch,'Hello world')
c.showPage()
c._pageSize =3D 100,100
c.drawString(0.3*inch,0.3*inch,'Blargh Yack!')
c.showPage()
c.save()
Thanks.
- I.
-----Original Message-----
From: Jerome Alet [mailto:alet@librelogiciel.com]
Sent: Friday, November 01, 2002 5:16 PM
To: reportlab-users@reportlab.com
Subject: Re: [reportlab-users] Changeing page orientation of canvas.
On Fri, Nov 01, 2002 at 04:57:53PM -0500, Ian Sparks wrote:
> Hmm..I tried to do :
>=20
> c =3D canvas.Canvas("hello.pdf",pagesize=3Dletter)
>=20
> c.drawString(0.3*inch,0.3*inch,'Hello world')
> c.showPage()
>=20
> c.pageSize =3D 200,200 #Change that page size
> c.drawString(0.3*inch,0.3*inch,'Hello world')
> c.showPage()
> c.save()
>=20
> this runs but my second page is still letter size. What did I miss?
an underscore ???
that's c._pagesize as reported by the pdfgen/canvas.py file in=20
the __init__ method
not sure if this is present in the documentation
hth
Jerome Alet
_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users
_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users
_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users