# Loading svg's

**URL:** <https://forums.creativeclouddeveloper.com/t/loading-svgs/890>\
**Category:** UXP Plugin API\
**Tags:** filesystem\
**Created:** [June 3, 2019, 2:18pm UTC](https://forums.creativeclouddeveloper.com/t/loading-svgs/890 "2019-06-03T14:18:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![b3u](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/b3u/32/233_2.png) [@b3u](https://forums.creativeclouddeveloper.com/u/b3u)\
**Post date:** [June 3, 2019, 2:18pm UTC](https://forums.creativeclouddeveloper.com/t/loading-svgs/890/1 "2019-06-03T14:18:23Z")

</div>

I’m attempting to load an svg file stored in the plugin folder. Is there a way to interpret the svg data as a `path` object, or will i have to parse it as text? Thanks.

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [June 3, 2019, 2:30pm UTC](https://forums.creativeclouddeveloper.com/t/loading-svgs/890/2 "2019-06-03T14:30:04Z")

</div>

You’ll need to parse it. For SVG paths, the syntax in XD is the same (for path objects), but other elements will need some handling on your end. That said, there may be some npm packages you could use to get most of the way.

---

<div class="post-metadata">

**Author:** ![cpryland](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/cpryland/32/1172_2.png) [@cpryland](https://forums.creativeclouddeveloper.com/u/cpryland)\
**Post date:** [June 6, 2019, 2:01pm UTC](https://forums.creativeclouddeveloper.com/t/loading-svgs/890/3 "2019-06-06T14:01:20Z")

</div>

[https://github.com/elrumordelaluz/element-to-path](https://github.com/elrumordelaluz/element-to-path) looks like it might work. No experience with it, though.

---

<div class="post-metadata">

**Author:** ![b3u](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/b3u/32/233_2.png) [@b3u](https://forums.creativeclouddeveloper.com/u/b3u)\
**Post date:** [June 6, 2019, 6:24pm UTC](https://forums.creativeclouddeveloper.com/t/loading-svgs/890/4 "2019-06-06T18:24:04Z")

</div>

I’m just copying the code to the clipboard. That way, the user can paste it wherever they want
