svgdoc.Ppi not respected
See original GitHub issueAccording to #313 one can set Ppi after creating an SvgDocument.
SvgDocument svgDoc = SvgDocument.Open(xmlDoc);
svgDoc.Ppi = (int)e.Graphics.DpiX;
...
svgDoc.Height = new SvgUnit(SvgUnitType.Millimeter, 20);
float h = (int) svgDoc.Height;
In my tests the printer device context DpiX value is 600 and this is definitely assigned to Ppi.
However, the value returned into h
is 75.6.
The correct result is 20 / 25.4 * 600 = 472.441
Working backward from the actual result 20 / 25.4 * dpi = 75.6 w have dpi = 75 / (20 / 25.4) = 96 which is the default dpi.
On this basis I assert that Ppi is not respected.
Rummaging, implicit conversion does this .ToDeviceValue(null, UnitRenderingType.Other, null)
and because owner is not supplied ppi is obtained from SvgDocument.PointsPerInch
which matches the observed behaviour.
What is the recommended way to do this kind of conversion?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
svgdoc.Ppi not respected · Issue #446 · svg-net/SVG
On this basis I assert that Ppi is not respected. Rummaging, implicit conversion does this .ToDeviceValue(null, UnitRenderingType.Other, null) and because owner ...
Read more >Set SvgUnit DPI · Issue #313 · svg-net/SVG
Hi, I am having trouble rendering my SVG using Batik as I am trying to render at a higher dpi than the default...
Read more >How to get started | SVG.NET API
After I load the SVG, I make new SVG with the same initial SvgDocument properties (basically a deep copy followed by deleting all...
Read more >Management of the Patient with Incomplete Response to ...
Hence, with an incomplete response to PPI therapy, a fundamental question is whether or not the persistent symptoms are attributable to reflux. Obtaining...
Read more >Proton Pump Inhibitor Nonresponders - PMC
One of the most common reasons that patients with GERD do not respond to PPI therapy is that they are not compliant with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Explicit conversion with a supplied owner also fails. I found the bug and corrected it, at some point I will do a PR
Does anyone has a work around this issue?