Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Glorfi opened this issue Nov 23, 2023 · 3 comments
Labels
reviewed Temporary label to review all open and closed PR

Comments

@Glorfi
Copy link

Glorfi commented Nov 23, 2023

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?

@waglons
Copy link

waglons commented Jan 18, 2024

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

@sebastienb
Copy link

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

@kozakdenys
Copy link
Owner

Hi @Glorfi, @waglons , @sebastienb
It should be partially fixed in version v1.8.0.
The image is still not displayed in Illustrator, but I can't fix it as Illustrator doesn't fully support SVG standard

@kozakdenys kozakdenys added the reviewed Temporary label to review all open and closed PR label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewed Temporary label to review all open and closed PR
Projects
None yet
Development

No branches or pull requests

4 participants