[reportlab-users] NextPageTemplate question
Chad Nantais
reportlab-users@reportlab.com
Mon, 19 May 2003 11:11:07 -0700
Thank you very much, Andy. By putting NextPageTemplate at the top of
my page, I got each unique page template render in the proper place.
Is there a way to count all the pages that have been created for a
document and then create a variable like totalPages so that I can
append something like "Page 1 of 8" automatically to each page?
Chad
--
Chad Nantais
Web Development Consultant
Rednaxel Interactive
cnantais@rednaxel.com
http://cnantais.rednaxel.com
On Monday, May 19, 2003, at 06:31 AM, Andy Robinson wrote:
>> Why would do my page templates lag behind after the itinerary page?
>> Or,
>> rather, why would pg 2 not take the NextPageTemplate directive and
>> apply
>> the statement template?
>
> My guess is that insertItinerary is either filling the page, or
> is inserting a page break at the end. So, the engine has
> already flipped over to page 2, still thinking the template
> to use is the Itinerary.
>
> NextPageTemplate literally means "use this the next
> time you see a page break". You need to set it before
> changing pages. So, if I am doing a letter with a
> 'covertemplate' and 'bodyTemplate', I usually puy
> my NextPageTemplate action pretty near the top
> of page 1.
>
> It has to be this way as the templates can draw stuff
> before any content is laid down, as well as after. We did
> discuss, but never implemented, something to "peek ahead"
> so that if the first thing on a page was a NextPageTemplate
> it would still work.
>
> Hope ths helps,
>
> Andy Robinson
>
>>
>> def _makeStory(self):
>> """ make story composed of sections """
>> story = []
>>
>> story += [NextPageTemplate('Itinerary')]
>> story += self._insertItinerary()
>> story += [NextPageTemplate('Statement')]
>> story += self._insertStatement()
>> story += [NextPageTemplate('Segment')]
>> story += self._insertSegments()
>> return story
>>
>> Thanks in advance.
>>
>> --
>>
>> Chad Nantais
>>
>> Web Development Consultant
>> Rednaxel Interactive
>>
>> cnantais@rednaxel.com
>> http://cnantais.rednaxel.com
>>
>> _______________________________________________
>> reportlab-users mailing list
>> reportlab-users@reportlab.com
>> http://two.pairlist.net/mailman/listinfo/reportlab-users
>>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
>