[QGIS-Developer] RV: PyQGIS QgsLayoutExporter gives error "QPen::setWidthF: Setting a pen width that is out of range"

Nyall Dawson nyall.dawson at gmail.com
Sun Jan 14 22:56:39 PST 2024


On Sun, 14 Jan 2024, 6:35 pm Robert via QGIS-Developer, <
qgis-developer at lists.osgeo.org> wrote:

> # Generate atlas
>
> # Es una QgsLayoutAtlas
>
> myAtlas.beginRender()
>
> myAtlas.next()
>
> for i in range(0, myAtlas.count()):
>
>
>
>     exporter = QgsLayoutExporter(myAtlas.layout())
>
> file_name=os.path.join(dir_destiny,'Individuals')+'/'+myAtlas.currentFilename()+".pdf"
>
>
>
>     pdf_settings=QgsLayoutExporter.PdfExportSettings()
>
>     pdf_settings.forceVectorOutput=False
>
>     pdf_settings.exportMetadata = False
>
>     pdf_settings.appendGeoreference = False
>
>
>
>     #pdf_settings.textRenderFormat = QgsRenderContext.TextFormatAlwaysOutlines  # For "Always Export Text as Paths"
>
>     pdf_settings.textRenderFormat = QgsRenderContext.TextFormatAlwaysText # For "Always Export Text as Text Objects"
>
>
>
>     pdf_settings.rasterizeWholeImage = True # For "Disable tiled raster layer exports" Hace que ocupe menos si es TRUE
>
>     pdf_settings.simplifyGeometries = False
>
>
>
>     exporter.exportToPdf(file_name,pdf_settings)
>
>
>
> Thank you In advance for your attention and help.
>

Have you stripped code out of this loop? Eg I can't see any call to
atlas.next() within the loop.

In any case what you have looks generally ok. You'd need to share more of
your code or project to diagnose further.

Nyall

>
>
> Kind regards,
>
>
>
> Robert Benet
>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240115/a160d8b1/attachment-0001.htm>


More information about the QGIS-Developer mailing list