# Import and export

**Export** is a button on the board and on a project. **Back up everything** is in the main menu. The dialog offers four formats.

## Editable file

**Editable file** downloads a `.draw` file. The button hint says the file opens again in Draw. The file is a zip. `draw.json` is the manifest. Copied pictures and files are stored at `assets/` plus the asset id.

A linked file is described and left out, unless you check **Include copies of linked files I can reach now**. That checkbox appears only for **Editable file**, and only when a linked file is in the export. A backup also stores starter layouts.

## Picture, Vector picture, and PDF

**Picture** downloads a PNG. **Vector picture** downloads an SVG. **PDF** downloads a PDF.

Those three formats share **Include background** and **Dark appearance**. **Include background** starts checked. **Dark appearance** starts unchecked.

**Picture** and **PDF** also have **Sharpness** at 1×, 2×, or 3×. The default is 2×. **Vector picture** has no sharpness control.

## The rendered box

The render fits the shapes and adds 32 pixels of padding on every side. **Export area** clips to the focus area bounds and does not add that padding. The SVG `width` and `height` are the resulting box, in pixels.

The PNG multiplies both sides by the sharpness. The PDF page uses the unscaled width and height as PDF points, and draws the PNG into that page. One PDF point equals one of those unscaled pixels. There is no A4 size and no Letter size.

## One file per board

One board becomes one file. A project, or a backup, renders one image per board. Several PNGs or SVGs are zipped. A PDF stays one file, with one page per board. **Export area**, in the **Focus areas** menu, exports that focus area alone.

## What the SVG contains

The SVG is not a list of shape paths. `renderShapesToSvg` writes one `svg` element, one `foreignObject`, and the board's HTML inside the `foreignObject`. The page CSS is inlined. Font files that cover the characters on the board are embedded. Chrome drew that SVG when the SVG was placed in a page. Other viewers were not checked.

## Where Import is

**Import** is on Home. **Import boards** is on a project. Drop a file on the dialog, or click **Choose a file…**. The picker accepts `.draw`, zip, and JSON.

A file whose first byte is `{` is read as JSON. Any other file must be a zip that contains `draw.json`.

## Manifest format and version

The manifest `format` must be `draw`. `version` must be the integer 1. A higher version shows the toast This file was made with a newer version of Draw.

A bad file shows one of these messages.

- This isn't a Draw file.
- This file is missing its board data.
- This file is damaged and can't be read.

## The kind value

`kind` is `board`, `area`, `project`, or `backup`. From Home, a backup restores every project and any starter layouts. From Home, any other kind imports the first project as a new project. From a project, every project's boards are added to that project.

Import writes new ids. Import does not merge into an existing board.

## A name that already exists

If the project name already exists, the dialog title quotes that name and says that name already exists. The choices are **Keep both**, **Back up first, then replace**, and **Replace**. **Replace** moves the old project to Trash.

## Shapes that fail validation

Shapes that fail validation are dropped. The rest of the file still imports. A file with no boards shows There are no boards in this file.
