[reportlab-users] Changeing page orientation of canvas.
Doug
reportlab-users@reportlab.com
Fri, 1 Nov 2002 22:58:54 -0500
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 = canvas.Canvas("hello.pdf",pagesize=letter)
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 = canvas.Canvas("hello.pdf",pagesize=letter)
c.drawString(0.3*inch,0.3*inch,'Hello world')
c.showPage()
c._pageSize = 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 :
>
> c = canvas.Canvas("hello.pdf",pagesize=letter)
>
> c.drawString(0.3*inch,0.3*inch,'Hello world')
> c.showPage()
>
> c.pageSize = 200,200 #Change that page size
> c.drawString(0.3*inch,0.3*inch,'Hello world')
> c.showPage()
> c.save()
>
> 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
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