From 7e5afef1e2bfd430f4440d8f143cc1d374bca6b4 Mon Sep 17 00:00:00 2001 From: Fabian Gundlach Date: Fri, 19 Mar 2021 15:49:20 +0100 Subject: [PATCH] Use a fresh context for each pdf output page Otherwise, larger pages after smaller pages are clipped to the smaller page's rectangle. --- src/renderer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer.cpp b/src/renderer.cpp index 1f6c101..8473483 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -294,6 +294,7 @@ void PDFExporter::save(Document* doc, const std::string& file_name) { } qDebug() << "Drawing mode:" << (simplistic ? "simplistic" : "general"); surface->set_size(UNIT_TO_POINT * page->width(), UNIT_TO_POINT * page->height()); + CairoGroup cg(cr); cr->rectangle(0, 0, page->width(), page->height()); cr->clip(); if (!simplistic) {