[reportlab-users] mix landscape and portrait pages with platypus

Alessandro Praduroux pradu at pradu.it
Fri Jan 14 03:35:30 EST 2005


def _landscape(canv, doc):
    canv.rotate(90)
    canv.translate(0,-A4[0])

def buildDocTemplate(fname, indexer):
    dt = BaseDocTemplate(fname)
    sb = 0
    address = Frame(dt.leftMargin + cm*8, A4[1] - 9.5*cm, 7*cm, 4*cm, 
id='address',showBoundary=sb)
    additional = Frame(0, A4[1] - 5.6*cm, 7*cm, 1*cm, 
id='additional',showBoundary=sb)
    summary = Frame(1*cm, 1*cm, A4[1] - 2*cm, A4[0] - 
2*cm,id='summary',showBoundary=sb)
    bollettini1 = Frame(-0.55*cm, (A4[0] / 2)+0.15*cm, A4[1], A4[0]/2 - 
1*cm,id='bollettini1',showBoundary=sb)
    bollettini2 = Frame(-0.55*cm, 0.2*cm, A4[1],A4[0]/2 - 
1.4*cm,id='bollettini2',showBoundary=sb)
    dt.addPageTemplates([PageTemplate(id='address',frames=[additional,address],onPageEnd=indexer.addressPage),
                         PageTemplate(id='summary',frames=summary,onPage=_landscape,onPageEnd=indexer.summaryPage),
                         PageTemplate(id='bollettini',frames=[bollettini1,bollettini2],onPage=_landscape,onPageEnd=indexer.ccpPage),
                        ])
    return dt

that's how I did it, note the onPage=_landscape in addPageTemplates, this 
worked pretty well for me, maybe there is a better way to do it.


Alle 00:48, venerdì 14 gennaio 2005, Lee Harr ha scritto:
> I googled around about this, but did not find what I was
> looking for...
>
> Is there a way to insert some portrait oriented pages in
> to an otherwise landscape oriented document?
>
> _________________________________________________________________
> FREE pop-up blocking with the new MSN Toolbar - get it now!
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users

-- 
Pradu
Linux webmaster & sysadmin
pradu at pradu.it
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
Url : http://two.pairlist.net/pipermail/reportlab-users/attachments/20050114/0ed16fbc/attachment.bin


More information about the reportlab-users mailing list