Convert embedded SVG to PNG in-place

后端 未结 6 662
自闭症患者
自闭症患者 2020-11-29 17:20

I\'m generating HTML from a Docbook source while using SVG for images (converted from MathML). This works fine for some browsers that can interpret SVG, but fails for others

6条回答
  •  無奈伤痛
    2020-11-29 18:15

    if you want to do it purely on the client-side, you would need two steps:

    1. convert SVG to Canvas (http://code.google.com/p/canvas-svg/ or some other tools)
    2. convert Canvas to PNG (http://www.nihilogic.dk/labs/canvas2image/ or some other tools)

    this obviously will work only in HTML5-capable browsers.

提交回复
热议问题