Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One out of twenty layouts cannot be printed to pdf #53

Closed
magerlin opened this issue May 24, 2023 · 1 comment
Closed

One out of twenty layouts cannot be printed to pdf #53

magerlin opened this issue May 24, 2023 · 1 comment
Labels

Comments

@magerlin
Copy link

I have a QGIS project with 20 layouts of which one cannot be printed to PDF (but it can be printed to PNG). All layouts are very similar.

Error message is:

Exporting layout '10 Vehicle lost time zoom' Traceback (most recent call last): File "C:\Users/MAP/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\MapsPrinter\processing_provider\export_layouts_from_project.py", line 163, in processAlgorithm result = self.processor.exportCompo(cView, outputFolder, title, extension, feedback=feedback) File "C:\Users/MAP/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\MapsPrinter\processor.py", line 97, in exportCompo exportSettings = self.overrideExportSettings(cView, extension) File "C:\Users/MAP/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\MapsPrinter\processor.py", line 212, in overrideExportSettings exportSettings.exportThemes = layout.customProperty('pdfExportThemes') TypeError: str cannot be converted to a C/C++ QStringList in this context

I am using QGIS version
3.30.2-'s-Hertogenbosch
and Maps Printer version 0.9
Under Windows 10

  • Maps Printer Version [e.g. 0.3]

Skærmbillede 2023-05-24 213621
Skærmbillede 2023-05-24 213644

@magerlin magerlin added the bug label May 24, 2023
@DelazJ
Copy link
Owner

DelazJ commented May 26, 2023

All layouts are very similar.

Actually, not really. That specific layout had one day been exported using the default export tool and had had geopdf options enabled, with probably some map themes selected.
The fix:

  1. You don't need/want the themes in your pdf: export that layout one more time using the standard way and when the PDF export options dialog pops up, uncheck the themes option. The new settings are saved upon exporting and will be used by maps printer then.

  2. You want themes in your PDF: in "C:\Users/MAP/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\MapsPrinter\processor.py", line 212, replace

    exportSettings.exportThemes = layout.customProperty('pdfExportThemes')

    with

    exportSettings.exportThemes = layout.customProperty('pdfExportThemes').split("~~~")

    And restart QGIS.

I didn't plan to release a new version soon, but..

@DelazJ DelazJ closed this as completed in 3fef016 May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants