Render plotly plots in pdf - no full width

Hello,
I’m trying to render a Form in PDF. Everything is working perfectly, except for a Plotly plot.
I want the plot to be full width. The preview in the template Form is correctly displayed, while in the final PDF the plot is only half-width (more or less).

Has this issue already occurred to someone else?
Thanks!

I have never had the issue, but others have converted the plotly plot to an image when they were having trouble with sizing and resolutions and such.
Search the forums for something like: “plotly svg”

Heres just one I found, it might help:

It worked, many thanks!

PS: I used:
plot_url = self.plot.to_image({‘format’:‘png’, ‘scale’:6})
self.image.source = plot_url

to obtain a satisfying image quality.

1 Like

@MattDa : Hi MattDa, have you managed to solve the topic without converting it to an image? I am currently experiencing the very same thing and in my use case the conversion to an image has a few disadvantages…

To do something like

self.plot_output.width = 500

works but obviously has some cons as well.

Thanks - Arne

Hi @Arne, no I solved converting the plot to an image and never tried something different since in my case It solved the issue and I was Happy with the final result.