summaryrefslogtreecommitdiffstats
path: root/printer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'printer.cpp')
-rw-r--r--printer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/printer.cpp b/printer.cpp
index c5867450f..7cef1104e 100644
--- a/printer.cpp
+++ b/printer.cpp
@@ -141,3 +141,18 @@ void Printer::print()
int Pages = ceil(getTotalWork(printOptions) / (float)divesPerPage);
render(Pages);
}
+
+void Printer::previewOnePage()
+{
+ if (printMode == PREVIEW) {
+ TemplateLayout t(printOptions, templateOptions);
+
+ pageSize.setHeight(paintDevice->height());
+ pageSize.setWidth(paintDevice->width());
+ webView->page()->setViewportSize(pageSize);
+ webView->setHtml(t.generate());
+
+ // render only one page
+ render(1);
+ }
+}