[reportlab-users] multiple frames on one page

Robin Becker robin at reportlab.com
Mon Aug 24 07:16:47 EDT 2009


Arkadi Colson wrote:

> Hi,

>

> Thanks for the quick response. Attached you can see the complete file

> but it will still not work because a lot of external classes are not

> there. But maybe you can find the reason this way.

> I did not start from a working example, I only needed one frame until now.

>

> Robin Becker wrote:

>> Arkadi Colson wrote:

.......
Not exactly sure what your' intending, but the two frame stuff appears to be
just the cover page(s) is that correct? So far as I can tell you're doing



> story.append( NextPageTemplate('cover') )

>

> self.nameTxt = dom.xpath('string(/pdf/cover/nameTxt)')

> self.name = dom.xpath('string(/pdf/cover/name)')

> self.vakTxt = dom.xpath('string(/pdf/cover/vakTxt)')

> self.vak = dom.xpath('string(/pdf/cover/vak)')

> self.klasTxt = dom.xpath('string(/pdf/cover/klasTxt)')

> self.klas = dom.xpath('string(/pdf/cover/klas)')

> self.syTitle = dom.xpath('string(/pdf/cover/syCover)')

> self.syTxt = dom.xpath('string(/pdf/cover/syTxt)')

> self.sy = dom.xpath('string(/pdf/cover/sy)')

> self.logo = dom.xpath('string(/pdf/cover/logo)')

> self.logoWidth = int(dom.xpath('string(/pdf/cover/logoWidth)'))

> self.logoHeight = int(dom.xpath('string(/pdf/cover/logoHeight)'))

> self.logoValid = int(dom.xpath('string(/pdf/cover/logoValid)'))

> self.ypTxt = dom.xpath('string(/pdf/cover/ypTxt)')

> self.ypTitle = dom.xpath('string(/pdf/cover/ypTitle)')

> self.metadataTitle = dom.xpath('string(/pdf/addons/metadataTitle)')

>

>

> doc.setTitle(self.ypTxt+" "+self.ypTitle)

>

> ### Cover BEGIN

> story.append( self.drawCoverInfo() )

> ### Cover END

>

> ### MetaData BEGIN

> story.append( NextPageTemplate('metadata') )

> story.append( PageBreak() )

The NextPageTemplate is intended to prime the interpreter so that the next time
you change pages you get the referred to template. I suspect that since cover is
already the first page template you don't need the NextPageTemplate append at
the beginning. Apart from that it looks right although if the content of
drawCoverInfo were small you might not see any usage of a second template.


Why don't you try tuning on all your showFrames and see where the frames
actually are.
--
Robin Becker


More information about the reportlab-users mailing list