Resize/scale SVG?
It looks like this is related to https://github.com/alafr/SVG-to-PDFKit/issues/24, but passing a width and height doesn't seem to work. Can we get proper instructions for how to achieve this added to the README?
Doesn't work for me, either; I had to size the drawing in the SVG.
When the SVG has its width and height attributes set they are used no matter what you specify in the options. Only when the SVG has no width and height attributes and only the viewport it works. But instead of preprocessing the SVGs, I figured out that you have to specify the preserveAspectRatio to match the same width and height you want to have:
this.doc.addSVG(src, x, y, {
width,
height,
preserveAspectRatio: `${width}x${height}`,
});
At least in my use case, it worked