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

Svg.SvgDocument Draw() return null #1027

Open
JDGrewal opened this issue Nov 18, 2022 · 3 comments
Open

Svg.SvgDocument Draw() return null #1027

JDGrewal opened this issue Nov 18, 2022 · 3 comments

Comments

@JDGrewal
Copy link

I'm using latest version 3.4.4 to convert base30 string to PNG and all working fine in development environment.

But when deployed to dev server, it throw a NullReferenceException.
Svg.SvgDocument Draw() function returns NULL Bitmap.

Example data

I'm converting base30 to SVG using custom code and than using Svg Document as follow

SvgDocument mySVG;
MemoryStream newStream = new MemoryStream(Encoding.Default.GetBytes(docSVG));
mySVG = SvgDocument.Open<Svg.SvgDocument>(newStream);

// then convert it to PNG
MemoryStream tempStream = new MemoryStream();
mySVG.Draw().Save(tempStream, System.Drawing.Imaging.ImageFormat.Png);
System.Drawing.Image img = System.Drawing.Image.FromStream(tempStream);
return img;

Used Versions

Please note this working fine in development environment but not on web server.

Older version 2.4.3.29446 was working fine on web server.

Thanks for help.

@H1Gdev
Copy link
Contributor

H1Gdev commented Nov 18, 2022

@JDGrewal

If it's version difference, I think it's this change.

#818 (comment)

@JDGrewal
Copy link
Author

JDGrewal commented Nov 18, 2022

I've changed the version of Svg.dll from 3.4.4 To 3.2.3.36087

Error stop but image saved as blank. And to fix this error, I've changed the version of following:

System.Memory.dll >> 4.5.5 To 4.6.27617.2
System.Runtime.CompilerServices.Unsafe.dll >> 6.0.0 To 4.6.26919.2

@H1Gdev
Copy link
Contributor

H1Gdev commented Nov 19, 2022

@JDGrewal

Can I publish the SVG file that causes this issue ?

3.2.3.36087

Do you mean this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants