0

I want to use PyQGIS3 to export some map composer using atlas,In this task I want to export only one feature from atlas layers to PNG image with specific unique name file.

output='/home/username/Desktop/uniquename.png'
settings = QgsLayoutExporter.ImageExportSettings()
QgsLayoutExporter.exportToImage(myAtlas, output, 'png', settings)

and I get only the default name of file :

output_1.png

How can I change this name with my unique name export?

And I add this lines without and still not work :

#myAtlas.setFilenameExpression(output)
#myAtlas.setPageNameExpression('uniquename')
#myAtlas.filePath(output, 'png')
1
  • Couly you please post more code, so that we can see how you define myAtlas? Also, please share how it does not work, including any output or error messages. Ideally, post a complete minimal runnable example that will allow anyone willing to help you to reproduce the problem on their part with as little extra work as possible!
    – til_b
    Oct 6 '20 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.