# Generate "device independant" SVG on Windows

**URL:** <https://forum.graphviz.org/t/generate-device-independant-svg-on-windows/2479>\
**Category:** Help\
**Created:** [October 7, 2024, 3:27pm UTC](https://forum.graphviz.org/t/generate-device-independant-svg-on-windows/2479 "2024-10-07T15:27:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![g-maxime](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@g-maxime](https://forum.graphviz.org/u/g-maxime)\
**Post date:** [October 7, 2024, 3:27pm UTC](https://forum.graphviz.org/t/generate-device-independant-svg-on-windows/2479/1 "2024-10-07T15:27:43Z")

</div>

Hi,

I’m using the Graphviz library to generate SVG graphs in both a CLI and GUI application. On Windows, the CLI works fine. However, since enabling DPI awareness in the GUI manifest, the dimensions of the generated SVG change based on the desktop scaling setting.

For example, with the same .dot input, at 100% scaling:

```auto
<svg width="490pt" height="655pt" viewBox="0.00 0.00 490.00 654.93" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><script xmlns=""/>
...

```

And at 200% scaling:

```auto
<svg width="914pt" height="992pt" viewBox="0.00 0.00 914.00 991.86" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><script xmlns=""/>
...

```

Is there a way to prevent this behavior?

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [October 8, 2024, 10:05pm UTC](https://forum.graphviz.org/t/generate-device-independant-svg-on-windows/2479/2 "2024-10-08T22:05:25Z")

</div>

Not convinced I understand the issue, but maybe one of these will help:

- add **size=N** , (where N in inches) to set graph display size
- try **-Tsvg:cairo** on the command line (it will use a different **svg** renderer) (see [Command Line | Graphviz](https://graphviz.org/doc/info/command.html#-T))

---

<div class="post-metadata">

**Author:** ![g-maxime](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@g-maxime](https://forum.graphviz.org/u/g-maxime)\
**Post date:** [October 14, 2024, 9:08am UTC](https://forum.graphviz.org/t/generate-device-independant-svg-on-windows/2479/3 "2024-10-14T09:08:29Z")

</div>

Thanks!

Cairo renderer output is more consistent. Now I have to rebuild my graphviz plugin with this renderer.
