[reportlab-users] help controlling page size
Tim Roberts
timr at probo.com
Mon Jul 2 17:24:43 EDT 2012
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.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the reportlab-users
mailing list