# QR code export (PNG, PDF, EPS, GIF, MP4, print size)

Export a styled QR code as PNG, JPEG, WebP, SVG, PDF or EPS at any pixel or print size, or as an animated GIF, APNG or MP4, checked by a decoder.

- Endpoint: `POST https://setget.net/v1/tools/qr-export` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `qr-export`
- Page: https://setget.net/tools/qr-export

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `text` (required, string): The exact text the code holds (the "text" of any QR tool's result).
- `format` (optional, string, one of `png`, `jpeg`, `webp`, `svg`, `pdf`, `eps`, `gif`, `apng`, `mp4`, default `"png"`): File to make: png, jpeg or webp pictures; svg, pdf or eps for print and design programs; gif, apng (animated PNG) or mp4 for a code that draws itself.
- `size` (optional, integer, default `1024`, range 64..8000): Width in pixels for png, jpeg and webp when no print size is given, and for animated files (up to 1,200).
- `print_size` (optional, number, range 0.5..2000): Printed width, in the unit below. Sets the page size of pdf, eps and svg files, and the pixel width of pictures together with dpi.
- `unit` (optional, string, one of `mm`, `cm`, `in`, default `"mm"`): Unit of print_size.
- `dpi` (optional, integer, default `300`, range 72..1200): Dots per inch for pictures made at a print size.
- `verify` (optional, boolean, default `true`): Read the finished code back with a decoder before returning it.
- `effect` (optional, string, one of `center`, `wipe`, `sparkle`, `eyes`, `rain`, default `"center"`): Animated files: how the code appears. Outward from the center, wiped across, sparkling in dot by dot, the three eyes first, or raining down.
- `duration` (optional, number, default `1.8`, range 0.5..6.0): Animated files: how long the code takes to appear, in seconds. The finished code then stays for two more.
- `repeat` (optional, string, one of `once`, `loop`, default `"once"`): gif and apng: play once and stay finished, or loop. A looping gif starts on the finished code.
- `error_correction` (optional, string, one of `L`, `M`, `Q`, `H`): How much damage the code survives: L about 7%, M 15%, Q 25%, H 30%. Higher levels hold less. Left out: M, or H when there is a logo.
- `module_size` (optional, integer, default `8`, range 1..40): Width of one small square (module) in pixels.
- `margin` (optional, integer, default `4`, range 0..20): Blank quiet zone around the code, in modules. Scanners expect at least 4.
- `foreground` (optional, string): Color of the dots: hex such as #000000, a basic color name, or a CSS linear-gradient(...) or radial-gradient(...). Left out: black.
- `background` (optional, string): Color behind the code: hex, a basic name, "transparent", or a CSS gradient. Left out: white.
- `preset` (optional, string, one of `classic`, `rounded`, `liquid`, `dots`, `ocean`, `sunset`, `forest`, `grape`, `candy`, `ink`, `gold`, `midnight`): A ready-made look. Any style input you set yourself wins over the preset.
- `dot_style` (optional, string, one of `square`, `rounded`, `liquid`, `dots`, `diamond`, `star`, `vertical`, `horizontal`, `leaf`, `mosaic`, `plus`, `hexagon`, `heart`, `maze`): Shape of the small squares (modules). Left out: square.
- `dot_scale` (optional, number, range 0.5..1): Size of each dot within its square, from 0.5 to 1. Thin shapes need more, such as diamond 0.7 and star 0.95 (the error names the least); liquid always fills its square.
- `eye_frame_style` (optional, string, one of `square`, `rounded`, `extra-rounded`, `circle`, `leaf`, `dotted`): Shape of the outer ring of the three corner eyes.
- `eye_ball_style` (optional, string, one of `square`, `rounded`, `circle`, `diamond`, `leaf`, `octagon`): Shape of the solid middle of the three corner eyes.
- `eye_colour` (optional, string): Color of the eye rings. Left out: the dot color.
- `eye_ball_colour` (optional, string): Color of the middle of the eyes. Left out: the eye ring color.
- `eye_colours` (optional, string): A color for each eye, separated by commas, in the order top-left, top-right, bottom-left: for instance "#b91c1c, #1d4ed8, #15803d". Plain colors only. An eye left out, or left empty between commas, keeps eye_colour.
- `corner_radius` (optional, number, range 0..0.5): Rounds the corners of the background, as a fraction of its side.
- `shape` (optional, string, one of `square`, `circle`, `squircle`, `octagon`, `hexagon`, `shield`, `bubble`, `heart`): Outline of the whole code: square, or a silhouette such as circle or heart. The code itself stays a complete square inside it, behind a clear ring as wide as margin, and matching dots fill the rest of the outline. Left out: square.
- `logo` (optional, file, a file reference such as `DROP_ID/f1`, accepts image): A picture for the middle of the code: PNG, JPEG, WebP, GIF or SVG. Large pictures are shrunk.
- `logo_size` (optional, number, range 0.1..0.4): Largest logo width as a fraction of the code, from 0.1 to 0.4. It is made smaller when the code would not scan. Left out: 0.22.
- `logo_padding` (optional, number, range 0..3): Clear space around the logo, in modules. Left out: 1.
- `logo_shape` (optional, string, one of `none`, `square`, `rounded`, `circle`): Shape of the clear area behind the logo. "none" leaves the background showing.
- `logo_background` (optional, string): Color of the clear area behind the logo. Left out: the background color.
- `logo_text` (optional, string): One to four characters for the middle of the code in place of a picture, such as initials. Drawn as outlines in the frame font, so they look the same everywhere.
- `logo_icon` (optional, string, one of `heart`, `star`, `wifi`, `phone`, `mail`, `link`, `home`, `pin`, `cart`, `bag`, `camera`, `music`, `calendar`, `person`, `globe`, `lock`, `gift`, `cup`, `bolt`, `chat`, `play`, `info`, `tag`, `book`): A small symbol for the middle of the code in place of a picture.
- `logo_colour` (optional, string): Color of the center text or symbol. Left out: the eye color.
- `background_image` (optional, file, a file reference such as `DROP_ID/f1`, accepts image): A photo to show behind the code. Large photos are shrunk.
- `background_image_wash` (optional, number, range 0..0.9): How much the photo is lightened, from 0 to 0.9. Left out: 0.35.
- `frame` (optional, string, one of `none`, `label`, `banner`, `banner-top`, `rounded`): A border with a short call to action under (or above) the code.
- `frame_text` (optional, string): The words in the frame. Left out: SCAN ME.
- `frame_colour` (optional, string): Color of the frame. Left out: the dot color.
- `frame_text_colour` (optional, string): Color of the frame text. Left out: whichever of dark or light reads best.
- `frame_font` (optional, string, one of `sans`, `mono`): Letter style of the frame text.

## Example 1: A 40 mm wide PDF for print

```json
{"input":{"text":"https://setget.net","preset":"ocean","format":"pdf","print_size":40},"wait":30}
```

## Example 2: A 2048 pixel PNG with a logo

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample-logo.png](https://setget.net/static/samples/sample-logo.png).

```json
{"input":{"text":"https://setget.net","logo":"DROP_ID/f1","format":"png","size":2048},"wait":30}
```

## Example 3: A looping GIF of the code sparkling in

```json
{"input":{"text":"https://setget.net","preset":"candy","format":"gif","size":480,"effect":"sparkle","repeat":"loop"},"wait":30}
```

**Which format should I use for print?** PDF or EPS keep the code perfectly sharp at any size and open in every design program. For pictures, give a print size and 300 dpi.

**How small can I print it?** The result says: "scan.min_print_width_mm" is the smallest comfortable width. A warning appears when a module would be under 0.4 mm.

**What does verified mean?** The finished file was read back by a decoder, sharp and small, and gave back exactly your text. Phone cameras are usually more forgiving than this check. For an animated file, the finished code is taken out of the file itself and read.

**Which animated format should I use?** GIF plays almost everywhere, including mail and chat. An animated PNG is sharper, keeps a see-through background, and shows the finished code wherever it is not played. MP4 is for slides, video editors and social posts. GIF and MP4 have no see-through pixels: a transparent background becomes white.

**Will a GIF show a code that scans if it does not play?** Choose repeat "loop": the file then starts on the finished code, which is what a program shows when it draws only the first frame. Every animated file ends on the finished code and holds it for two seconds.
