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.
Input
Result
Choose a file and press Run.
Live preview, drawn in your browser. Press Run for the finished file.
Files you upload and the results are stored for one hour, then deleted. Anyone who has the link can open them, so don't upload anything private.
Use it from code or an agent
# 1. Upload the file. The reply ends with a line "ref <id>/f1": that is the file reference.
# 2. Run the tool with that reference. "wait" holds the reply for up to 30 seconds while the job runs.
curl -s https://setget.net/v1/tools/qr-export \
-H 'Content-Type: application/json' \
-d '{"input":{"text":"https://setget.net","preset":"ocean","format":"pdf","print_size":40},"wait":30}'
# 3. The reply is {"tool", "ms", "result", "files": [{"name", "size", "url", "ref"}], "job"}.
# Download a result file from its "url", or pass its "ref" to another tool.
# Still running after the wait? The reply is 202 with "job": follow it with
# curl -s https://setget.net/v1/jobs/JOB_ID?wait=30
import json, urllib.parse, urllib.request
BASE = "https://setget.net"
def call(method, path, body=None, headers=None):
request = urllib.request.Request(BASE + path, body, headers or {}, method=method)
return json.load(urllib.request.urlopen(request))
def upload(path):
"""Step 1: upload a file and get its reference."""
name = path.replace("\\", "/").rsplit("/", 1)[-1]
with open(path, "rb") as handle:
reply = call("PUT", "/drop/" + urllib.parse.quote(name), handle.read(), {"Accept": "application/json"})
return reply["file"]["ref"]
# Step 2: run the tool with the reference.
body = {"input": {'text': 'https://setget.net', 'preset': 'ocean', 'format': 'pdf', 'print_size': 40}, "wait": 30}
reply = call("POST", "/v1/tools/qr-export", json.dumps(body).encode(), {"Content-Type": "application/json"})
# Step 3: a job that is still running comes back as {"job": ...}. Wait for it.
while "result" not in reply and reply.get("job", reply).get("status") in ("queued", "running"):
reply = call("GET", "/v1/jobs/" + reply.get("job", reply)["id"] + "?wait=30")
if "error" in reply:
raise SystemExit(reply["error"]["message"])
print(reply["result"])
for file in reply["files"]: # result files: download from "url", or pass "ref" to another tool
print(file["name"], file["size"], file["url"], file["ref"])
const BASE = "https://setget.net";
// Step 1: upload a file and get its reference. file: a File or Blob
// (in Node: new Blob([fs.readFileSync(path)])).
async function upload(file, name) {
const response = await fetch(`${BASE}/drop/${encodeURIComponent(name)}`, {
method: "PUT", headers: {Accept: "application/json"}, body: file,
});
return (await response.json()).file.ref;
}
// Step 2: run the tool with the reference.
let reply = await (await fetch(`${BASE}/v1/tools/qr-export`, {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({input: {"text":"https://setget.net","preset":"ocean","format":"pdf","print_size":40}, wait: 30}),
})).json();
// Step 3: a job that is still running comes back as {job}. Wait for it.
while (!reply.result && ["queued", "running"].includes((reply.job || reply).status)) {
reply = await (await fetch(`${BASE}/v1/jobs/${(reply.job || reply).id}?wait=30`)).json();
}
if (reply.error) throw new Error(reply.error.message);
console.log(reply.result);
for (const file of reply.files) console.log(file.name, file.size, file.url, file.ref);
1. Upload. Tool: drop
Arguments:
{
"action": "create",
"files": []
}
PUT each file's bytes to its "upload.url" with the listed headers, and keep its "ref".
With a shell, one command does both: curl -T FILE https://setget.net/drop/
2. Run. Tool: run_tool
Arguments:
{
"slug": "qr-export",
"input": {
"text": "https://setget.net",
"preset": "ocean",
"format": "pdf",
"print_size": 40
}
}
3. The answer holds "result" and "files" (each with "url" and "ref").
If it holds a "job" that is still running instead, follow it. Tool: job
Arguments:
{
"action": "wait",
"id": "JOB_ID"
}
{
"input": {
"text": "https://setget.net",
"preset": "ocean",
"format": "pdf",
"print_size": 40
},
"wait": 30
}
This is a file tool, so a call takes three steps: upload the file to get a reference, run the tool with that reference, then read the result and download its files. Uploads and results are public by link and expire after one hour.
Endpoint: POST /v1/tools/qr-export. Over MCP: run_tool with slug: "qr-export".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
text |
string | yes | The exact text the code holds (the "text" of any QR tool's result). |
format |
string | no | 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. One of: png, jpeg, webp, svg, pdf, eps, gif, apng, mp4. Default: "png". |
size |
integer | no | Width in pixels for png, jpeg and webp when no print size is given, and for animated files (up to 1,200). Default: 1024. From 64 to 8000. |
print_size |
number | no | 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. From 0.5 to 2000. |
unit |
string | no | Unit of print_size. One of: mm, cm, in. Default: "mm". |
dpi |
integer | no | Dots per inch for pictures made at a print size. Default: 300. From 72 to 1200. |
verify |
boolean | no | Read the finished code back with a decoder before returning it. Default: true. |
effect |
string | no | Animated files: how the code appears. Outward from the center, wiped across, sparkling in dot by dot, the three eyes first, or raining down. One of: center, wipe, sparkle, eyes, rain. Default: "center". |
duration |
number | no | Animated files: how long the code takes to appear, in seconds. The finished code then stays for two more. Default: 1.8. From 0.5 to 6.0. |
repeat |
string | no | gif and apng: play once and stay finished, or loop. A looping gif starts on the finished code. One of: once, loop. Default: "once". |
error_correction |
string | no | 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. One of: L, M, Q, H. |
module_size |
integer | no | Width of one small square (module) in pixels. Default: 8. From 1 to 40. |
margin |
integer | no | Blank quiet zone around the code, in modules. Scanners expect at least 4. Default: 4. From 0 to 20. |
foreground |
string | no | Color of the dots: hex such as #000000, a basic color name, or a CSS linear-gradient(...) or radial-gradient(...). Left out: black. |
background |
string | no | Color behind the code: hex, a basic name, "transparent", or a CSS gradient. Left out: white. |
preset |
string | no | A ready-made look. Any style input you set yourself wins over the preset. One of: classic, rounded, liquid, dots, ocean, sunset, forest, grape, candy, ink, gold, midnight. |
dot_style |
string | no | Shape of the small squares (modules). Left out: square. One of: square, rounded, liquid, dots, diamond, star, vertical, horizontal, leaf, mosaic, plus, hexagon, heart, maze. |
dot_scale |
number | no | 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. From 0.5 to 1. |
eye_frame_style |
string | no | Shape of the outer ring of the three corner eyes. One of: square, rounded, extra-rounded, circle, leaf, dotted. |
eye_ball_style |
string | no | Shape of the solid middle of the three corner eyes. One of: square, rounded, circle, diamond, leaf, octagon. |
eye_colour |
string | no | Color of the eye rings. Left out: the dot color. |
eye_ball_colour |
string | no | Color of the middle of the eyes. Left out: the eye ring color. |
eye_colours |
string | no | 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 |
number | no | Rounds the corners of the background, as a fraction of its side. From 0 to 0.5. |
shape |
string | no | 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. One of: square, circle, squircle, octagon, hexagon, shield, bubble, heart. |
logo |
file | no | A picture for the middle of the code: PNG, JPEG, WebP, GIF or SVG. Large pictures are shrunk. In the API: a file reference such as DROP_ID/f1. Accepts: image. |
logo_size |
number | no | 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. From 0.1 to 0.4. |
logo_padding |
number | no | Clear space around the logo, in modules. Left out: 1. From 0 to 3. |
logo_shape |
string | no | Shape of the clear area behind the logo. "none" leaves the background showing. One of: none, square, rounded, circle. |
logo_background |
string | no | Color of the clear area behind the logo. Left out: the background color. |
logo_text |
string | no | 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 |
string | no | A small symbol for the middle of the code in place of a picture. 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. |
logo_colour |
string | no | Color of the center text or symbol. Left out: the eye color. |
background_image |
file | no | A photo to show behind the code. Large photos are shrunk. In the API: a file reference such as DROP_ID/f1. Accepts: image. |
background_image_wash |
number | no | How much the photo is lightened, from 0 to 0.9. Left out: 0.35. From 0 to 0.9. |
frame |
string | no | A border with a short call to action under (or above) the code. One of: none, label, banner, banner-top, rounded. |
frame_text |
string | no | The words in the frame. Left out: SCAN ME. |
frame_colour |
string | no | Color of the frame. Left out: the dot color. |
frame_text_colour |
string | no | Color of the frame text. Left out: whichever of dark or light reads best. |
frame_font |
string | no | Letter style of the frame text. One of: sans, mono. |
Examples
A 40 mm wide PDF for print
{
"text": "https://setget.net",
"preset": "ocean",
"format": "pdf",
"print_size": 40
}Press the example button above to run it on the sample file.
A 2048 pixel PNG with a logo
{
"text": "https://setget.net",
"logo": "sample-logo.png",
"format": "png",
"size": 2048
}Press the example button above to run it on the sample file.
A looping GIF of the code sparkling in
{
"text": "https://setget.net",
"preset": "candy",
"format": "gif",
"size": 480,
"effect": "sparkle",
"repeat": "loop"
}Press the example button above to run it on the sample file.
Questions
- 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.
Related tools
- QR code generator
Make a scannable QR code from any text or link, styled your way: colors, gradients, dot shapes, a logo and a frame.
qr-generate - Animated QR code
Make a QR code that draws itself: an animated SVG in any style that ends as a complete, scannable code.qr-animate - Bulk QR code generator
Make up to 500 styled QR codes at once from a list or CSV: a zip of files plus an optional printable label sheet.qr-batch - QR code readerRead the text or link stored in a QR code from a picture or screenshot, and show where each code is.
qr-decode - SVG to PNGRender an SVG drawing to a PNG image at any size, with a transparent or solid background.
svg-to-png - .gitignore generatorBuild a .gitignore for the languages, editors and operating systems you use, merged without duplicates.
gitignore-generate