how to save/ export inline SVG styled with css from browser to image file

前端 未结 4 1653
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-01 17:43

I have a web app that is generating inline SVG graphics in the client on the fly based on user interaction. The graphic is defined partly by element attributes and partially by

4条回答
  •  爱一瞬间的悲伤
    2021-02-01 18:00

    You will need to explicitly set the calculated css styles as SVG dom style properties for each SVG element before saving it. Here is an example:

    
        
        
        
            
        
        
    
    
    image original:
    image computed:

提交回复
热议问题