print_preview — Camelot documentation

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- view »
- action_steps »

# print_preview

class `camelot.view.action_steps.print_preview.` `PrintHtml`(html)

  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>)

  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)

  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.

  `render`()

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

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- view »
- action_steps »

Comments
blog comments powered by Disqus