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

JPEG images in pattern #107

Closed bottle1125 closed 5 years ago

bottle1125 commented 5 years ago

Hi, I tried to add images like 'data:image/jpeg;base64,....' as a pattern,

<svg id="svgElement" xmlns="http://www.w3.org/2000/svg" width="100px" height="340px">
<defs>
   <pattern id="pattern1" width="200" height="100" patternUnits="userSpaceOnUse" patternContentUnits="userSpaceOnUse">
                <image href="data:image/png;base64,...."  width="200" height="100"/>
</pattern>
</defs>
<rect width="200" height="100" fill="url(#pattern1)" stroke="black"/>
</svg>

But it didn't work. I'm not sure if it's a bug. Thanks.

HackbrettXXX commented 5 years ago

This is a bug of jsPDF. I created an issue for this: https://github.com/yWorks/jsPDF/issues/26. I'm closing this issue in favor of the other one.

HackbrettXXX commented 4 years ago

Fixed in yWorks/jsPDF#26.