[reportlab-users] help controlling page size

Justin Shepard jshepdev at gmail.com
Mon Jul 2 16:58:58 EDT 2012


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')

3. I also adjusted the frames and pdf elements in case that was somehow
forcing the size to adjust, but that didn't do anything.

Any ideas on how to control the page size?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20120702/b1c76f3c/attachment.html>


More information about the reportlab-users mailing list