You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you everyone for your work on this library! It's amazing.
I'm trying to resize an SVG path, but would like to maintain the same stroke width when its rendered.
Please see this JS Fiddle with some example code: https://jsfiddle.net/vg6rwz4b/1/
I've scaled the group down to 10% and the path coordinates adhere correctly.
Notice the vector-effect="non-scaling-stroke" on line 4 and what happens when you remove it.
When the SVG is pasted used in SVGtoPDFKit, its as if the property is not there and it renders as
Rather than the intended:
Any thoughts on how we might add support for this property? I'm more than happy to contribute, but need a bit of pointing in the right direction
Thanks!
The text was updated successfully, but these errors were encountered:
I'm not sure how to implement this new behaviour, but I guess you will have to apply a second transformation to the pdf document (with doc.transform()), apply a transformation to the shape (with shape.transform()) and draw the transformed shape (with shape.insertInDocument()).
A doc.transform() call must be between a doc.save() and a doc.restore(), so that other operations later remain unchanged.
Last step, when you have something working well for simple shapes, will be to make it work with the more complex elements (such as text), check the behaviour for zero-length paths (https://github.com/alafr/SVG-to-PDFKit/blob/master/source.js#L1817-L1819), ... This last step is not 100% needed, something that works with only some of the svg elements (if it does not break some existing functionality in the other elements) would already be a huge improvement.
First of all, thank you everyone for your work on this library! It's amazing.
I'm trying to resize an SVG path, but would like to maintain the same stroke width when its rendered.
Please see this JS Fiddle with some example code: https://jsfiddle.net/vg6rwz4b/1/
I've scaled the group down to 10% and the path coordinates adhere correctly.
Notice the
vector-effect="non-scaling-stroke"
on line 4 and what happens when you remove it.When the SVG is pasted used in SVGtoPDFKit, its as if the property is not there and it renders as
Rather than the intended:
Any thoughts on how we might add support for this property? I'm more than happy to contribute, but need a bit of pointing in the right direction
Thanks!
The text was updated successfully, but these errors were encountered: