You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose js an api function for saving figures as png/pdf/jpeg/eps/etc with config #89
which would then trigger the download of the requested file (similar to how the snapshot button triggers a png download right now)
Being able to easily save to to a vector image backend like pdf or eps with specified sizes and dpi would be amazing -- then I could publish my plotly figures in latex based research articles.
@spencerlyon2 another option if you would like to handle pdf's in the browser could be jsPDF, although I haven't used it, and it may not play nicely with plotly plots - you would need to convert from canvas -> png -> pdf using jsPDF.
svg, png, jpg and webp to-image exports are now available natively via Plotly.toImage as of #446.
For vector-quality pdf or eps figures, I would recommend exporting your graph to an svg and using a conversion utility such as imageMagick to convert the svg to a pdf or eps.
Activity
etpinard commentedon Dec 9, 2015
Marked as duplicate of #83
All image formats listed other than png and svg required a convert step outside the js realm. That is, this will never be part of plotly.js.
Luckily, the plotly cloud handle all those image formats for you. For example, in node.js.
mdtusz commentedon Dec 9, 2015
@spencerlyon2 another option if you would like to handle pdf's in the browser could be jsPDF, although I haven't used it, and it may not play nicely with plotly plots - you would need to convert from canvas -> png -> pdf using jsPDF.
sglyon commentedon Dec 9, 2015
OK no problem, I can handle it outside of the plotly/javascript realm.
Is there as suggested method for causing the download of an SVG?
etpinard commentedon Dec 9, 2015
@spencerlyon2 this is what #83 will attempt to solve.
etpinard commentedon Jan 26, 2016
closed in favout of #83
etpinard commentedon May 16, 2016
svg,png,jpgandwebpto-image exports are now available natively viaPlotly.toImageas of #446.For vector-quality
pdforepsfigures, I would recommend exporting your graph to ansvgand using a conversion utility such as imageMagick to convert the svg to a pdf or eps.etpinard commentedon May 16, 2016
@timelyportfolio oops. Fixed above. Thanks!