diff options
Diffstat (limited to 'printer.cpp')
-rw-r--r-- | printer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/printer.cpp b/printer.cpp index 635778042..115b17526 100644 --- a/printer.cpp +++ b/printer.cpp @@ -3,6 +3,7 @@ #include "statistics.h" #include "helpers.h" +#include <algorithm> #include <QtWebKitWidgets> #include <QPainter> #include <QWebElementCollection> @@ -150,6 +151,8 @@ void Printer::print() pageSize.setWidth(printerPtr->pageRect(QPrinter::Inch).width() * dpi); webView->page()->setViewportSize(pageSize); webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); + // export border width with at least 1 pixel + templateOptions->border_width = std::max(1, pageSize.width() / 1000); webView->setHtml(t.generate()); if (printOptions->color_selected && printerPtr->colorMode()) { printerPtr->setColorMode(QPrinter::Color); |