[reportlab-users] help controlling page size
rbastian at free.fr
Tue Jul 3 03:30:50 EDT 2012
Le Mon, 2 Jul 2012 14:24:43 -0700,
Tim Roberts <timr at probo.com> a écrit :
> Justin Shepard wrote:
> > I'm trying to create a pdf that is letter size (8.5 x 11 inches);
> > however, no matter what I change it's coming out as 8.27 x 11.69
> > inches. I can't include the entire code but here is what I have
> > done.
> > 1. Imported what I think are the necessary modules:
> > from reportlab.platypus import BaseDocTemplate, Frame,
> > NextPageTemplate, PageBreak, PageTemplate, Paragraph, Table
> > from reportlab.lib.units import inch
> > from reportlab.lib.pagesizes import letter
> > 2. set base tempate (I've tried a few variations here):
> > docTemplate = BaseDocTemplate(docTemplatePath,
> > pageSize=(612,792))#'letter')
> > -or-
> > docTemplate = BaseDocTemplate(docTemplatePath, pageSize='letter')
> You may want to find a pillow to scream into when I tell you that the
> parameter is spelled "pagesize", not "pageSize".
> It is a historical anomaly.
from anomaly import ...
and in anomaly.py
pageSize = pagesize :)
More information about the reportlab-users