svg2pdf.js icon indicating copy to clipboard operation
svg2pdf.js copied to clipboard

<use> does not clip text tags correctly

Open Qendolin opened this issue 4 years ago • 1 comments

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 SVG and PDF

Desktop

  • OS: Windows
  • Browser Chrome 89
  • Version 10

Qendolin avatar Apr 14 '21 19:04 Qendolin

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

HackbrettXXX avatar Apr 15 '21 07:04 HackbrettXXX