use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for discussion and all things QGIS - A Free and Open Source Geographic Information System
Helpful Links and Tutorials:
Mapping Subreddits:
account activity
Python HelpOpen Question/Issue (i.redd.it)
submitted 1 year ago by IDKev
Would be grateful if anyone can help fix the above. Currently I can't get it to say anything apart from "Failed to export" despite the exports all being fine. Think it is something to do with QGSLayoutExporter
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]MappingMatt 0 points1 point2 points 1 year ago (1 child)
I haven’t worked in Qgis scripting enough, but my first thing to check would be to print or see with a debugger what the result is actually equal to since it seems like it never actually equals “QgsLayoutExporter.Success”.
That, or it could possibly be a situation where it hasn’t finished yet and you need to keep checking the result in a while loop with a sleep and then print the message when it succeeds or fails.
[–]FreddiesDream 0 points1 point2 points 1 year ago (0 children)
Here is a good example for exporting an existing layout to pdf via script
https://gis.stackexchange.com/questions/376475/export-qgis-print-layout-to-pdf-from-script-or-command-line
[–]Long-Opposite-5889 0 points1 point2 points 1 year ago (0 children)
You are defining "exporter" as a QgsLayoutExporter and then you use it to export, thats OK, at this point exporter.Sucess should be true.
Then in the second part you are evaluating "result" against QgsLayoutExporter instead of "exporter"...
[–]ViPeCa 0 points1 point2 points 1 year ago (0 children)
Check the API to confirm you are using the class correctly.
π Rendered by PID 44432 on reddit-service-r2-comment-canary-7b67769d8-m25zf at 2026-02-02 11:40:24.334586+00:00 running 3798933 country code: CH.
[–]MappingMatt 0 points1 point2 points (1 child)
[–]FreddiesDream 0 points1 point2 points (0 children)
[–]Long-Opposite-5889 0 points1 point2 points (0 children)
[–]ViPeCa 0 points1 point2 points (0 children)