In plotly.js/src/snapshot/download.js, Promise returned by toImage() resolves SVG data i.e. result passed to fileSaver() is SVG data if opts.format = 'svg'.
So, modification of the result before passing it to fileSaver() is a possible way to make PDF data.
For making PDF data, the below library might be useful:
https://github.com/yWorks/svg2pdf.js
In plotly.js/src/snapshot/download.js, Promise returned by
toImage()resolves SVG data i.e.resultpassed tofileSaver()is SVG data ifopts.format = 'svg'.So, modification of the
resultbefore passing it tofileSaver()is a possible way to make PDF data.For making PDF data, the below library might be useful:
https://github.com/yWorks/svg2pdf.js