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

image elements with different width/height attributes than the source image are stretched #108

Open HackbrettXXX opened 5 years ago

HackbrettXXX commented 5 years ago

This is probably due to a missing viewBox transformation. However, reading the widths from bitmap images is probably not trivial.

HackbrettXXX commented 3 years ago

Repro

LanderBeeuwsaert commented 8 months ago

We're running into this issue as well. A start of a solution to toe svg2pdf code seems to be:

image

which I took from: https://github.com/parallax/jsPDF/issues/3401

HackbrettXXX commented 7 months ago

Good idea. I would happily merge a PR.

LanderBeeuwsaert commented 7 months ago

@HackbrettXXX we intend to put this (and in larger view, html => svg => pdf) up as a student project. But that will only start in september 2024. At that moment we hope for the student to solve this and deliver a PR.