def gen_flowable(self, style_options):
     options = dict(style_options)
     # explicit :option: always precedes
     options.update(self.options)
     visitor = aafigure.process('\n'.join(self.content),
                                aafigure.pdf.PDFOutputVisitor,
                                options=options)
     return renderPDF.GraphicsFlowable(visitor.drawing)
예제 #2
0
    def _showDrawingDemo(self, drawing):
        """Show a graphical demo of the drawing."""

        # Add the given drawing to the story.
        # Ignored if no GD rendering available
        # or the demo method does not return a drawing.
        try:
            flo = renderPDF.GraphicsFlowable(drawing)
            self.story.append(Spacer(6, 6))
            self.story.append(flo)
            self.story.append(Spacer(6, 6))
        except:
            if VERBOSE:
                print 'caught exception in _showDrawingDemo'
                traceback.print_exc()
            else:
                pass
예제 #3
0
    def _showWidgetDemo(self, widget):
        """Show a graphical demo of the widget."""

        # Get a demo drawing from the widget and add it to the story.
        # Ignored if no GD rendering available
        # or the demo method does not return a drawing.
        try:
            if VERIFY:
                widget.verify()
            drawing = widget.demo()
            flo = renderPDF.GraphicsFlowable(drawing)
            self.story.append(Spacer(6, 6))
            self.story.append(flo)
            self.story.append(Spacer(6, 6))
        except:
            if VERBOSE:
                print 'caught exception in _showWidgetDemo'
                traceback.print_exc()
            else:
                pass