svg2pdf.js
svg2pdf.js copied to clipboard
<use> does not clip text tags correctly
Describe the bug
<text> tags referenced by <use> aren't clipped correctly.
The text exists in the pdf (can be selected) but is partially or completely invisible.
Versions: jsPDF: 2.3.1 svg2pdf.js: 2.1.0
To Reproduce
Reference a <text> tag in a <use> tag.
See playground
Expected behavior
The complete text referenced by the <use> tags should be visible in the pdf.
Screenshots

Desktop
- OS: Windows
- Browser Chrome 89
- Version 10
Thanks for reporting this bug. Seems like the bounding boxes aren't correct for text elements. This looks very suspicious ;): https://github.com/yWorks/svg2pdf.js/blob/90f6b853692844bea93ebf0415dc566f327cf958/src/nodes/text.ts#L230-L232