Hi,
First of all, thank you very much for this great tool.
To give you a bit of context before explaining my issue, I work at a university and I am developing an application that allows students to evaluate their teachings. One of the goals is to provide the teachers with a PDF file that contains the evaluation results at the end of the process. Teachers may then use this document to apply to other universities, or for their assessment interview.
I understand that this is not a top-priority feature : https://surveyjs.answerdesk.io/ticket/details/t11787.
I recall seeing a suggestion mentioning the use of HTML to PDF javascript libraries to tackle this issue; however I have tried several options and I never managed to get an acceptable result due to the plots being shifted (either on FF, or Chrome, or Safari) when generating the PDF document.
So I figured out another solution would be to download all plots as images (as images are much easier to export than svg graphics), and then "reinject" them into the HTML page. However I am reluctant to the idea of downloading ±10 image files on the user's computer before being able to create the PDF… and I can't seem to redirect them to a buffer to avoid downloading them.
So, I was wondering if there could be an option to display the plots as images instead of a Plotly graph ? I saw that such a functionality exists in the Plotly documentation : https://plotly.com/javascript/plotlyjs-function-reference/#plotlytoimage.
In my case, I imagine the scenario as follows :
The teacher displays the result page, configures each plot display settings and then clicks on "Export results to PDF".
When this happens, each plot would be converted to an image, keeping the plots display settings.
Then, I would be able generate the PDF file.
If this works, I think it might be a good workaround before having a "real" PDF export. What do you think ?
Hello Nicolas,
Thank you for contacting us. I also appreciate the detailed explanation.
Provided that PDF export is not in our short-term list, I believe you may indeed consider exporting chart to images using the dedicated API.
We will be happy to assist you with displaying plots as images. To save the results to PDF, it will be sufficient for a teacher to print the web page using the browser built-in print functionality (Ctrl+P).
I noted down the following inquiry and forwarded it to the team: Dashboard - Display charts as Images.
We'll let you know once we make any progress with this task.
Thank you