yWorks / svg2pdf.js

A javascript-only SVG to PDF conversion utility that runs in the browser. Brought to you by yWorks - the diagramming experts
MIT License
654 stars 100 forks source link

SVG symbols not displaying in PDF #110

Closed paulnordlund closed 4 years ago

paulnordlund commented 4 years ago

I'm using jspdf-yworks and svg2pdf.js to create a PDF. Here is a jsfiddle with an example: https://jsfiddle.net/paulnordlund/9k50jtrx/8/

I'm expecting labels (e.g. title "Phosphosite Intensity") to display on the downloaded PDF, but they are not. Is this a bug? If not, could you help me understand why symbols instantiated by use elements (<use y="14.732422" x="30.789062" xlink:href="#3951_1-0-glyph3-1>) are not rendered on the PDF?

HackbrettXXX commented 4 years ago

svg2pdf does not support <glyph> elements. It is only capable of rendering text with <text> and <tspan> elements.

paulnordlund commented 4 years ago

thanks for your answer, HackbrettXXX

yGuy commented 4 years ago

This is something we would like to add in the future. I'm reopening this to document this missing feature. If anybody wants to contribute - we're open to pull-requests!