572 def test1(self): |
572 def test1(self): |
573 #test from Wietse Jacobs |
573 #test from Wietse Jacobs |
574 from reportlab.lib.styles import ParagraphStyle |
574 from reportlab.lib.styles import ParagraphStyle |
575 from reportlab.graphics.shapes import Drawing, Rect |
575 from reportlab.graphics.shapes import Drawing, Rect |
576 from reportlab.platypus import SimpleDocTemplate |
576 from reportlab.platypus import SimpleDocTemplate |
|
577 from reportlab.platypus.flowables import DocAssign, DocExec, DocPara |
577 normal = ParagraphStyle(name='Normal', fontName='Helvetica', fontSize=8.5, leading=11) |
578 normal = ParagraphStyle(name='Normal', fontName='Helvetica', fontSize=8.5, leading=11) |
578 header = ParagraphStyle(name='Heading1', parent=normal, fontSize=14, leading=19, |
579 header = ParagraphStyle(name='Heading1', parent=normal, fontSize=14, leading=19, |
579 spaceAfter=6, keepWithNext=1) |
580 spaceAfter=6, keepWithNext=1) |
580 d = Drawing(400, 200) |
581 d = Drawing(400, 200) |
581 d.add(Rect(50, 50, 300, 100)) |
582 d.add(Rect(50, 50, 300, 100)) |
582 |
583 |
583 story = [Paragraph("The section header", header), d] |
584 story = [Paragraph("The section header", header), d, |
|
585 DocAssign('currentFrame','doc.frame.id'), |
|
586 DocAssign('currentPageTemplate','doc.pageTemplate.id'), |
|
587 DocAssign('aW','availableWidth'), |
|
588 DocAssign('aH','availableHeight'), |
|
589 DocAssign('aWH','availableWidth,availableHeight'), |
|
590 DocPara('repr(doc._nameSpace)'), |
|
591 ] |
584 doc = SimpleDocTemplate('test_drawing_keepwithnext.pdf') |
592 doc = SimpleDocTemplate('test_drawing_keepwithnext.pdf') |
585 doc.build(story) |
593 doc.build(story) |
586 |
594 |
587 def makeSuite(): |
595 def makeSuite(): |
588 return makeSuiteForClasses(PlatypusTestCase) |
596 return makeSuiteForClasses(PlatypusTestCase) |