[reportlab-users] Forcing doc templates to use pagesize?

Robin Becker reportlab-users@reportlab.com
Sat, 10 May 2003 11:15:52 +0100


In article <909F50C8-82C7-11D7-B468-00039345C610@darwin.in-berlin.de>,
Dinu Gherman <gherman@darwin.in-berlin.de> writes
>Hi,
>
>does anybody understand why the following simple code does *not*
>create a rectangular page of size 10x10 cm, but a portrait A4 one,
>no matter what pagesize I'm passing to the document template?
>
>Thanks,
>
>Dinu
>
.....
Dinu the page templates also have a pagesize and rather stupidly they
have an initial default pagesize that gets set to defaultPageSize. There
is now more or less complicated logic in checkPageSize to set the canvas
pagesize at the start of each page.

As currently written the template size has higher priority than the
document's. To get least surprise we should probably change the default
template size to be None so that the doc size gets used if no explicit
size is set on the template.

I've tested that this indeed works. Should we go ahead and do this? What
do others think?
-- 
Robin Becker