Questions tagged [canvg]

canvg is an SVG parser and renderer. It takes a URL to an SVG file or the text of an SVG file, parses it in JavaScript, and renders the result on a Canvas element. The rendering speed of the examples is about as fast as native SVG.

From http://code.google.com/p/canvg/

canvg is an SVG parser and renderer. It takes a URL to an SVG file or the text of an SVG file, parses it in JavaScript, and renders the result on a Canvas element. The rendering speed of the examples is about as fast as native SVG.

131 questions
1
vote
0 answers

canvas toDataUrl() returning black image

I'm creating a canvas based on svg using canvg and then through canvas I'm downloading an image. Here is the code for creating an canvas taking svg. //Creating the canvas var myCanvas = document.createElement("CANVAS"); canvg(myCanvas, res[0],{…
1
vote
1 answer

How to use canvg and svg to pdf in angular 2?

This is my Script Code. I m using JSPdf. //Add event listener document.getElementById("getPdf").addEventListener("click", getPdf); function getPdf() { //Get svg markup as string var svg = document.getElementById('svg-container').innerHTML; …
Angu
  • 862
  • 2
  • 13
  • 32
1
vote
1 answer

Appending a div containing canvas is not working

I am making use of canvg to convert svg present in div into canvas(upto this it's working fine) and then copying the innerHTML of div to another div, but it's not working. Canvas is coming but nothing will be present in that canvas. Thanks in…
Kumar
  • 270
  • 1
  • 4
  • 17
1
vote
0 answers

Canvas not generated using canvg on IE edge

Canvas not getting generated in IE edge only, instead a black box is appearing. Plugin used is Canvg svg = '
infinityskyline
  • 369
  • 2
  • 4
  • 17
1
vote
1 answer

Find the browsers default value for a CSS property with JavaScript

Is it possible to retrieve the browsers default value for a CSS property, ignoring any inline/imported styles, using JS? Some context: I'm using JS to in-line all styles on a specific SVG element and its children (which allows me to turn it into a…
DBS
  • 9,110
  • 4
  • 35
  • 53
1
vote
0 answers

how use canvg for convert svg of bubble chart to png?

how i can use canvg library to convert bubble chart to png? i draw a bubble chart with highcharts library. when i use canvg and save to png i see a empty png. var svg = new Highcharts().getSVG() var canvas =…
mrmr68
  • 178
  • 3
  • 13
1
vote
1 answer

canvg not working in Edge

I am taking webpage screenshot of svg content using canvg. In Chrome, Opera and IE11 it seems to work fine, however in Edge browser it only weirdly renders black background with no content on the canvas. Try it here in Edge browser Open the link…
Gagan
  • 305
  • 1
  • 13
1
vote
1 answer

Converting an SVG to a canvas while excluding the area outside the SVG viewbox

I need to convert the visible area of the SVG to a static image for printing and similar purposes. I gather from reading that the approach should be to first convert the SVG to a canvas using canvg, and then convert the canvas to an image using…
Brian Sweeney
  • 6,693
  • 14
  • 54
  • 69
1
vote
2 answers

Convert SVG to image in PNG

i am converting angular nvd3 chart to svg using html2canvas and canvg plugings but when i convert pie chart to png then i looks same as chart but when i convert line chart or area chart then its background goes to black and some circle drown on…
Dixit
  • 1,359
  • 3
  • 18
  • 39
1
vote
1 answer

Canvas save as image [canvg - rendering svg on canvas]

I'm trying to save the canvas to the file from the web page. The canvas is pretty complicated and has been built from several images (few semi-transparent .png files, 2 svg elements, and 4 other canvases) and no matter how I'm trying to save it,…
Darkest
  • 49
  • 8
1
vote
0 answers

Exporting svg with transform value result in gray line at beginning in D3js - Canvg

I ma exporting my svg created in D3js using cannvg. Whenever there is transform value to svg, a gray line is coming in exported image. If we remove gray line is gone. (Line is displayed in green circle) Here is my code for svg var svg…
Don
  • 1,334
  • 1
  • 10
  • 18
1
vote
1 answer

When printing with canvg the cart labels are behind the chart

http://jsfiddle.net/jjhii/46bv10db/1/ data canvg(document.getElementById('canvas'), svg); Another view, easier to see the problem. http://jsfiddle.net/46bv10db/5/ In the above example you…
John Hughes
  • 367
  • 1
  • 3
  • 20
1
vote
1 answer

Canvg - canvas changes on mousemove

I am using canvg in order to render some SVG into an image. Currently SVG to canvas part is working just fine. However I am unable to determine why the generated canvas changes when a pointer enters it. Do I really have to copy the generated canvas,…
user3707125
  • 3,394
  • 14
  • 23
1
vote
1 answer

height,width and font not consistent when converting svg to png

I am trying to convert svg to png and I found that the converted image is not the same as svg. How can as assure consistency among both svg and png? Code to covert svg to png jQuery('#imgDiv').css({display: 'block', 'padding-left': '25px',…
kinkajou
  • 3,664
  • 25
  • 75
  • 128
1
vote
2 answers

D3 to image on MS Edge

I have the following code and use it to retrieve D3 image for use in a PDF file. This has been working great until I tried it on Microsoft Edge. Anybody run across this or have suggestions on how to work around it. Basically the image comes back…
John Hughes
  • 367
  • 1
  • 3
  • 20
1 2 3
8 9