kozakdenys / qr-code-styling

Automaticly generate your styled QR code in your web app.

Home Page:https://qr-code-styling.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Downloaded SVG turns to blacksquare when opened with Illustrator and other editors

Glorfi opened this issue · comments

Hi there! Thanks for the awsome library. Yet there's an issue with downloaded SVG file.
Once I download an SVG file and try to open it with something other than a browser or Figma, it turns into a black square when I import it for instance in Adobe Illustrator or Photoshop. Any ideas on how to solve it?

Bellow is sample SVG generated with the library.
sample_generated_qr_svg

The options used to make one:

const getOptions = () => {
return {
width: 200,
height: 200,
type: 'canvas' as DrawType,
data: props.url,
image: data:image/svg+xml;base64,${btoa(getLogo(''))},
margin: 0,
qrOptions: {
typeNumber: 0 as TypeNumber,
mode: 'Byte' as Mode,
errorCorrectionLevel: 'H' as ErrorCorrectionLevel,
},
imageOptions: {
hideBackgroundDots: true,
imageSize: 0.4,
margin: 20,
crossOrigin: 'anonymous',
},
dotsOptions: {
color: qrColor,
type: 'rounded' as DotType,
},
backgroundOptions: {
color: '#FFFFFF',
},
cornersSquareOptions: {
color: qrColor,
type: '' as CornerSquareType,
},
cornersDotOptions: {
color: qrColor,
type: '' as CornerDotType,
},
} as Options;
};

Any ideas on how to solve it?

Try opening the file in Illustrator with a "File > Open" instead of dragging it in. We noticed that solved this issue.

having the same issue in sketch.
CleanShot 2024-06-04 at 10 18 38@2x