lyqht / mini-qr

Generate customized qr codes easily 👾
https://mini-qr-code-generator.vercel.app
GNU General Public License v3.0
613 stars 77 forks source link

Unable to view exported SVG fully in Adobe Illustrator #52

Open lyqht opened 2 months ago

lyqht commented 2 months ago

Description

Why this happens

In https://github.com/tsayen/dom-to-image/issues/64, it was mentioned that toSvgElement doesn't actually create a proper SVG element with paths/shapes. It simply creates a foreignObject, which is usually recognizable on web browsers. This is also why the exported SVGs render as expected on this GitHub repo's README.md.

However graphic editor softwares like InkScape, Adobe illustrator cannot recognize the SVG file format.

Issue

This issue is reported by Mihai Scelcunov

image

Logo missing

image


rucksman commented 2 months ago

Same here. If I remove the logo in mini-qr-code-generator.vercel.app with preset "Default" and try to open the SVG in Illustrator, I get the error message

Clipping is lost when exporting to SVG Tiny format

After confirming the message with "OK", I can only see the corner elements in Illustrator: image

All the other elements are there somehow which can be seen by pressing CTRL+a, but they are not filled: image

lyqht commented 2 months ago

I might have to create a fork of the qr code library that i'm using to generate the qr code to fix this issue, it's not trivial

lyqht commented 1 month ago

Hello @rucksman, i merged a fix, give it a try, it should work now!

rucksman commented 1 month ago

Unfortunately it does not work for me.

First try: Used default profile in https://mini-qr-code-generator.vercel.app/. There is an error message in Illustrator (something like "Clipping is lost when exporting to SVG Tiny format"). After confirming with "OK", again there are no elements visible, at least the logo is there: image And as before after selecting everthing, I can see that the elements exist (but are not visible): image

Second try: Uploaded a SVG for the image. Same error message and no logo at all: image

Third try: As before but with a PNG. Same error on opening, logo is there, but no other elements visible: image

lyqht commented 1 month ago

Aww, It looked fine on Inkscape, but Illustrator probably processes it differently, i will reopen the issue. Thanks for helping to replicate!