diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b20ab4..ec5b5dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +* Fix Python exception about PDF rasterized + ## 3.4.0 - 2024-05-27 * Bump QGIS minimum version to QGIS 3.22 diff --git a/atlasprint/core.py b/atlasprint/core.py index 6993e9f..f782186 100755 --- a/atlasprint/core.py +++ b/atlasprint/core.py @@ -22,6 +22,7 @@ from qgis.gui import QgsLayerTreeMapCanvasBridge, QgsMapCanvas from .logger import Logger +from .tools import to_bool __copyright__ = 'Copyright 2021, 3Liz' __license__ = 'GPL version 3' @@ -217,7 +218,7 @@ def print_layout( # Default to PDF # PDF settings if atlas_layout: - settings.rasterizeWholeImage = atlas_layout.customProperty("rasterize", False) + settings.rasterizeWholeImage = to_bool(atlas_layout.customProperty("rasterize", False), default_value=False) # Export result, error = QgsLayoutExporter.exportToPdf(atlas or report_layout, str(export_path), settings) # Let's override error message