135 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
2
answers
86
views
Why are scaleWidth and scaleHeight unusually large in the canvg options?
My code snippet produces the output I want...well close.
However, I am struggling to understand why scaleWidth and scaleHeight needed to be 400.
My goal was to have the SVG drawn with a width & ...
0
votes
1
answer
51
views
How can I draw an SVG over what already exists in a canvas?
What I am trying to do is draw the SVG over the blue circle on the canvas. The blue circle should be the background.
However, the result is just the SVG.
The final result should look something like
(...
0
votes
1
answer
60
views
How can I change the color of the svg?
I am using canvg inside of a Web Worker to draw an SVG into an OffscreenCanvas.
I will draw the SVG in black. Is it possible to apply a color to the SVG without modifying the SVG itself or using CSS? ...
0
votes
2
answers
126
views
canvg canvas getting slower with each edit/ memory usage increase
I have developed a scientific application to measure the area of shapes drawn on a scanned paper using canvg (version 3. something). The application works mostly fine (in Chrome), but gets really slow ...
2
votes
1
answer
421
views
How to use Canvg javascript library offline in a browser without server?
I'm developing a Firefox extension and for security issues I need to use Canvg offline, in a browser without server. I would like to use it in a pure js script. I have read the documentation but there ...
1
vote
1
answer
201
views
Import Canvg v4 in TypeScript project
I have an old TypeScript project with the following tsconfig:
{
"compilerOptions": {
"baseUrl": "./src",
"outDir": "build/dist",
"...
0
votes
1
answer
143
views
Upload an image from a canva javascript to an SVG
Here's the beginning of my codeI made some plots in a javascript canvas and I would like to be able to download them in svg format directly to my computer's hard drive. So I made a button, and a ...
1
vote
0
answers
203
views
How to generate JavaScript output from the latest Canvg version(4.0.1)?
We are using the Canvg plugin version(2.0.0) (https://github.com/canvg/canvg) in our Javascript project. We are trying to upgrade it to the latest version (4.0.1). We don't use any package manager ...
0
votes
1
answer
891
views
Canvg error: Cannot read properties of undefined (reading 'documentElement')
For my application I am using Canvg (also jsPDF, but that's not relevant) and when I invoke the canvg() method it gives me this error:
Uncaught TypeError: Cannot read properties of undefined (reading '...
1
vote
0
answers
402
views
How to download PNG image using s3 URL to it's SVG in ReactJs?
I want to download as a PNG image using amazon s3 url which is a svg.
What's the ideal way to convert this SVG to PNG and download it?
s3 URL: https://eocs-icons.s3.amazonaws.com/withText/2022/clean....
0
votes
1
answer
401
views
Animated SVGs in canvg on node.js - how to render/request next frame?
I have a node.js process with a canvas that is being exported to a frame buffer as a bitmap (RGBA values in Uint8Array).
Now I want to draw SVG to this canvas, and found canvg which works well for ...
0
votes
1
answer
271
views
Does canvg still have a way to trigger code when the render is finished?
There used to be a way to add a callback function renderCallback.
I've searched high and low but can't seem to find any examples of how to replicate that in canvg 3.x.
Is there anyone who can point me ...
0
votes
0
answers
212
views
html2canvas not renderig svg (chartist line)
I am using chartist to take a screenshot of my page which contains a chart line and save it to the server, the page is displayed correctly but the chart is not rendered. I did some research before ...
0
votes
1
answer
2k
views
Downloading Canvas as JPG/PNG returns blank image
So, I'm using canvg and the function which converts svg file to a jpg/png just downloads and ignores id of a svg block element, so I get the blank image, what could be wrong? Maybe Vue does not ...
0
votes
0
answers
46
views
SVG/Canvas with background image to png conversion gives black background [duplicate]
I have a svg with background patterns defined using images. To convert this SVG into png and save in disk , I am using canvg to convert first into canvas and into png image as follows:
const canvas =...