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
3
votes
2 answers

Do I need to remove or delete HTML elements that I created but didn't attach to the DOM?

I'm implementing client side download of some (High)charts that I have. What I'm doing now is getting the SVG source of the charts, creating a "canvas" element & drawing the SVG to said element, and then downloading the image using…
nal88
  • 33
  • 4
3
votes
2 answers

Combine two SVG elements into one using Javascript?

Let's say I have the following html context, which I don't have access to its creation :
What I'm trying…
Mojimi
  • 2,561
  • 9
  • 52
  • 116
3
votes
1 answer

s.substr is not a function

I am using canvg, but when I run this: jQuery("#print").on("click", function() { mySvg(); }); function mySvg() { var svg = jQuery("#map svg"); canvg(document.getElementById('canvas'), svg); } I get this in console canvg.js:58 Uncaught…
Roberto Marras
  • 153
  • 2
  • 11
3
votes
0 answers

Gradient background not getting in screenshot

I have a d3 chart in my application and what I want is to take a screenshot of the chart. I am using html2canvas.js and canvg.js plugin to convert the div content to base64 string. I used inline styles for plotting the chart. I got this solution…
user3501613
  • 596
  • 7
  • 28
3
votes
1 answer

Convert Inline svg to canvas using canvg script

I have this website: http://materialground.com/icon-maker I have this code above my body
3
votes
2 answers

SVG to Canvas with canvg not respecting css

I'm attempting to convert my SVG to canvas to get a png. everything is working great except for the css positioning. please see this jsfiddle you can see the top section which is the SVG. I am using canvg to render the svg on the canvas…
Kudos
  • 375
  • 4
  • 14
3
votes
1 answer

Cross Origin amazon S3 not working using chrome

Our website is having a problem, with chrome, loading images from amazon S3 with crossOrigin attribute setted on "Anonymous". Our S3 server is setted with: `
user3642612
  • 31
  • 1
  • 3
3
votes
1 answer

Styling errors when converting inline SVG to png

My high level goal is to convert a
element containing a few inline svg images to a png file. All operations must be performed within the client browser using JavaScript. I have tried: using canvg library and following the steps from this…
Chuanqi Sun
  • 1,123
  • 14
  • 26
3
votes
1 answer

How to draw a svg in multiple locations, on top of another svg image

I have drawn a floor map of a super market using MS Visio 2013. I have converted it to a svg file. What i want to do is to pin point some locations of the floor map using another svg file. I have tried this by many other means. I created a html 5…
direndd
  • 642
  • 2
  • 16
  • 47
3
votes
1 answer

canvg not working with IE 10

I am working on converting svg to png. For this conversion I am using canvg. This conversion is working fine with google chrome but IE 10 gives the following error message. Unhandled exception at line 137, column 5 in…
Abinaya Selvaraju
  • 1,212
  • 1
  • 10
  • 16
3
votes
0 answers

html2canvas save SVG

I have a site where into a page I can click on a png and i load an SVg external. With a colorpicker I can change its color, with draggable and resizable I can change position and dimension of my SVG. Now i want to save with html2canvas this SVG. I…
Alessandro Minoccheri
  • 35,521
  • 22
  • 122
  • 171
3
votes
1 answer

Save image/octet-stream, base64 encoded as image file via Rails

I am using canvg library to save google graph as image. More about this process can be found on this page. Ok, so JS framework provides me with encoded data of image and I POST that data using form and hidden field which triggers download. HTML…
Haris Krajina
  • 14,824
  • 12
  • 64
  • 81
2
votes
1 answer

How to fix cairo error in node.js app: Assertion failed: (angle_max >= angle_min)

ERROR I GET: Assertion failed: (angle_max >= angle_min), function _cairo_arc_in_direction, file cairo-arc.c, line 189. With some svg icons my code works fine, but some of them cause issue (error above) const svgContent =…
2
votes
0 answers

jsPDF: How to properly render HTML + SVG to PDF (using html2pdf.js and canvg.js)?

I am using Treant.js javascript library to create an organisational chart, and jsPDF (along with html2pdf.js and canvg.js) to convert the chart to PDF. Yo convert the SVG elements (the lines that connect the boxes) and HTML contents (the boxes) to…
Tanuj Dhaundiyal
  • 183
  • 1
  • 2
  • 15
2
votes
1 answer

Convert SVG to an image/png using JS/PHP

In my case I use Highcharts for rendering charts. This library gives the charts in SVG. I want to save an image/png from this SVG, saved server side, so I can use it there. First I use the canvg parser (https://github.com/gabelerner/canvg) to grab…
Harmster
  • 31
  • 6
1
2
3
8 9