I need to generate a 2 pages pdf report. Pages are completely independent. tried using:
mycanvas.drawString(x, y, "Printing on Page 1")
mycanvas._pageNumer = 2
mycanvas.drawString(x, y, "Printing on Page 2")
and:
mycanvas.drawString(x, y, "Printing on Page 1")
P = PageBreak()
P.drawOn(p, 0, 1000)
mycanvas.drawString(x, y, "Printing on Page 2")
But everything is printed on the same page.
How should I add a page break to this Canvas instance ?
Cheers...
I'm new to reportlab, but page 11 of the User Guide suggests that
Canvas's showPage method will work:
"The showPage method causes the canvas to stop drawing on the current
page and any further operations will draw on a subsequent page (if
there are any further operations -- if not no new page is created)."
( http://www.reportlab.com/docs/reportlab-userguide.pdf )
--Chris
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users
When drawing with the canvas, use
myCanvas.showPage()
The _pageNumber tells you it's a private variable you are not supposed
to modify. The PageBreak() object is also for use within Platypus -
long, flowing documents - and it sends a message to the document
processor (DocTemplate class) to output a new page. It should not
be used with the Canvas.
I'm hoping our various manuals and test cases point people correctly
but if we had any misleading documentation anywhere, please point it
out so we can improve it!
Best Regards,
--
Andy Robinson
CEO/Chief Architect
ReportLab Europe Ltd.
Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK
Tel +44-20-8545-1570