print_preview

class camelot.view.action_steps.print_preview.PrintHtml(html)[source]

Display a print preview dialog box for an html string.

Parameters:html – a string containing the html to render in the print preview.

the rendering of the html can be customised using the same attributes as those of the PrintPreview class.

class camelot.view.action_steps.print_preview.PrintJinjaTemplate(template, context={}, environment=<camelot.core.templates.environment>)[source]

Render a jinja template into a print preview dialog.

Parameters:
  • template – the name of the template as it can be fetched from the Jinja environment.
  • context – a dictionary with objects to be used when rendering the template
  • environment – a jinja2.Environment object to be used to load templates from. This defaults to the environment object available in camelot.core.templates
class camelot.view.action_steps.print_preview.PrintPreview(document)[source]

Display a print preview dialog box.

Parameters:document – an instance of QtGui.QTextDocument or QtWebKit.QWebView that has a print_() method. The thread affinity of this object will be changed to be able to use it in the GUI.

the print preview can be customised using these attributes :

page_size

the page size, by default QtGui.QPrinter.A4 is used

page_orientation

the page orientation, by default QtGui.QPrinter.Portrait is used.

../../../_images/simple_report1.png
render()[source]

create the print preview widget. this method is used to unit test the action step.

Previous topic

orm

Next topic

select_file

This Page


Comments
blog comments powered by Disqus