# ImportSVG

> Kicks off an SVG file import.

## Definition

* **Type:** Method
* **Namespace:** [Unity.VectorGraphics](/engine/6000.7/script-reference/unity/vectorgraphics.md)
* **Assembly:** UnityEngine.VectorGraphicsModule

## ImportSVG(TextReader, float, float, int, int, bool)

Kicks off an SVG file import.

```csharp
public static SVGParser.SceneInfo ImportSVG(TextReader textReader, float dpi = 0, float pixelsPerUnit = 1, int windowWidth = 0, int windowHeight = 0, bool clipViewport = false)
```

### Parameters

**** (\[TextReader]\(https\://learn.microsoft.com/dotnet/api/system.io.textreader)): The reader object containing the SVG file data**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The DPI of the SVG file, or 0 to use the device's DPI**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): How many SVG units fit in a Unity unit**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The default with of the viewport, may be 0**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The default height of the viewport, may be 0**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether the vector scene should be clipped by the SVG document's viewport

### Returns

| Type                                                                                     | Description                                  |
| ---------------------------------------------------------------------------------------- | -------------------------------------------- |
| [SceneInfo](/engine/6000.7/script-reference/unity/vectorgraphics/svgparser/sceneinfo.md) | A SceneInfo object containing the scene data |

## ImportSVG(TextReader, ViewportOptions, float, float, int, int)

Kicks off an SVG file import.

```csharp
public static SVGParser.SceneInfo ImportSVG(TextReader textReader, ViewportOptions viewportOptions, float dpi = 0, float pixelsPerUnit = 1, int windowWidth = 0, int windowHeight = 0)
```

### Parameters

**** (\[TextReader]\(https\://learn.microsoft.com/dotnet/api/system.io.textreader)): The reader object containing the SVG file data**** (\[ViewportOptions]\(/engine/6000.7/script-reference/unity/vectorgraphics/viewportoptions)): The viewport options to use**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The DPI of the SVG file, or 0 to use the device's DPI**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): How many SVG units fit in a Unity unit**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The default with of the viewport, may be 0**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The default height of the viewport, may be 0

### Returns

| Type                                                                                     | Description                                  |
| ---------------------------------------------------------------------------------------- | -------------------------------------------- |
| [SceneInfo](/engine/6000.7/script-reference/unity/vectorgraphics/svgparser/sceneinfo.md) | A SceneInfo object containing the scene data |
