You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SvgDocument svgDocument = SvgDocument.Open(this.SVGPath).FixImageSize();
svgDocument.ShapeRendering = SvgShapeRendering.Auto;
svgDocument.Ppi = 150;
//Draw on A4 paper
Bitmap bmp = new Bitmap(4960, 7015);
bmp.SetResolution(600, 600);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
svgDocument.Draw(g);
g.Flush();
bmp.Save("D:\\1.bmp");
First Problem :Text layout Error
150 PPI
250 PPI
350 PPI
600 PPI
Second Problem :Image size(maybe it's not a bug)
When we setsolution for Bitmap object, the meaning is keeping physical size (cm / mm / inch) . Graphics should auto-resize drawing objects to fit the resolution. but SvgDocument.Ppi changes the physical size. In other words, SvgDocument convert between physical-unit and pixel always on 96 PPI.
150 PPI
250 PPI
350 PPI
600 PPI
The text was updated successfully, but these errors were encountered:
let me show these problems by code and image:
SVG File
C# Code
First Problem :Text layout Error
150 PPI
250 PPI
350 PPI
600 PPI
Second Problem :Image size(maybe it's not a bug)
When we setsolution for Bitmap object, the meaning is keeping physical size (cm / mm / inch) . Graphics should auto-resize drawing objects to fit the resolution. but SvgDocument.Ppi changes the physical size. In other words, SvgDocument convert between physical-unit and pixel always on 96 PPI.
150 PPI
250 PPI
350 PPI
600 PPI
The text was updated successfully, but these errors were encountered: