[reportlab-users] how do you make the page portrait?

Jerome Alet reportlab-users@reportlab.com
Tue, 29 Jul 2003 14:34:34 +0200


Hi,

On Tue, Jul 29, 2003 at 11:16:54AM +0100, Proboscis Admin wrote:
>  
> I have the following code but how do i make  the page portrait? is it 
> correct?please advice. 
> 
> d = canvas.Canvas("Scheme1.pdf", pagesize =pagesizes.A4) 
> (pgwidth, pgheight) = pagesizes.A4 

pagesizes.A4 is portrait

use :

        (pgwidth, pgheight) = pagesizes.A4
        landscapeA4 = (pgheight, pgwidth)
        d = canvas.Canvas("Scheme1.pdf", pagesize=landscapeA4)
        
if you want.        

NB pagesizes module already define functions to transform from
portrait to landscape and the other way around.

> d = Drawing(500,500) 

There you overwrite your reference to the Canvas object you've
just created.

Not to offend you, but I think you should read the some Python
documentation before trying to use the ReportLab toolkit's API.
This requires minimal Python programming skills, or you may prefer to
use ReportLab's RML which may be easier to use.

bye,

Jerome Alet