# Convert to PS

Group: Document. PostScript. The API converts 6 formats to PS. These are the options, by input format.

## Example

cURL:

```bash
curl https://api.switchfile.io/v1/convert \
  -H "Authorization: Bearer $SWITCHFILE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/input.emf","to":"ps","options":{"width":1280}}'
```

Node.js:

```js
const res = await fetch("https://api.switchfile.io/v1/convert", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SWITCHFILE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"url":"https://example.com/input.emf","to":"ps","options":{"width":1280}}),
});
console.log(await res.json());
```

## From 5 formats

Inputs: emf, fodg, odg, otg, wmf

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `password` | string | not set | Password to open the file. |
| `width` | integer | not set | Width in pixels; the drawing keeps its shape. At most 20000. (1 to 20000 px) |
| `height` | integer | not set | Height in pixels; the drawing keeps its shape. At most 20000. (1 to 20000 px) |
| `pixel_density` | integer | 96 | Pixels per inch used to turn pixel sizes into a page size. 96 is the SVG standard. At most 2400. (1 to 2400) |

## From SVG

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `width` | integer | not set | Width in pixels; the drawing keeps its shape. At most 20000. (1 to 20000 px) |
| `height` | integer | not set | Height in pixels; the drawing keeps its shape. At most 20000. (1 to 20000 px) |
| `pixel_density` | integer | 96 | Pixels per inch used to turn pixel sizes into a page size. 96 is the SVG standard. At most 2400. (1 to 2400) |
