[reportlab-users] PageTemplate's onPageEnd

Nicholas Wieland nicholas_wieland at yahoo.it
Sat Aug 6 05:14:10 EDT 2005


 - Tim Roberts :
> On Fri, 5 Aug 2005 12:05:50 +0200 (CEST), Nicholas Wieland 
> <nicholas_wieland at yahoo.it> wrote:
> 
> >Ok, some more infos that suggest that probably I didn't undestand 
> >onPageEnd ...
> >I've added the footer to my first PageTemplate (the cover), and the 
> >generated pdf contained the big rect on the first and second page, exactly 
> >at the same place.
> >I'm lost, I don't know why RL calls onPageEnd for both pages, even if I 
> >use it only on the first, and why it doesn't call it when I explicitely 
> >ask for it, on the second page. 
> 
> 
> Ah, I see the problem, I think.  You are assuming that BaseDocTemplate 
> will automatically advance to the second PageTemplate when the cover 
> page is complete.  Not so.  BaseDocTemplate never changes the 
> PageTemplate on its own.  Thus, it's never getting to your second 
> template.  YOU need to do the switch when you detect the particular 
> conditions for a change.  Take a look at SimpleDocTemplate in 
> doctemplate.py.  Notice how it uses handle_pageBegin to switch to the 
> second page template.
> 
> In fact, you may find that SimpleDocTemplate is a better base for you 
> than BaseDocTemplate, unless you expect to need some unusual effects.  
> Alternatively, you can append a NextPageTemplage() call in your 
> report_story at the point where you want to change templates.

Thank you very much, I'll try your suggestion on Monday.

  ngw

-- 
checking for life_signs in -lKenny... no
	Oh my god, make (1) killed Kenny ! You, bastards !

nicholas_wieland-at-yahoo-dot-it

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it


More information about the reportlab-users mailing list