KRA to PDF API
POST a .kra to /v2/convert/kra/to/pdf and get a one-page PDF with the merged layers as a lossless image. The page is sized from the pixels at 96 per inch unless you pick A3, A4, A5, Letter or Legal, and the sample adds 10 mm margins on every side.
- Endpoint
- POST /v2/
convert/ kra/ to/ pdf - Accepts
- kra
- Sample timing
- 28 ms median of 5 runsHow we measure
- Request size
- Up to 10 MB on the Free plan or 100 MB on paid plans, all files together
Request and response
Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.
curl -sS -X POST \
https://api.pdfconversionapi.com/v2/convert/kra/to/pdf \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@rocket-sticker.kra \
--form-string MarginHorizontal=10 \
--form-string MarginVertical=10 \
-o response.json
# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
mkdir -p converted
name=$(jq -r '.Files[0].FileName' response.json)
jq -r '.Files[0].FileData' response.json \
| base64 --decode > "converted/$name"
else
cat response.json
fiimport base64
import os
import requests
key = os.environ["PDFCONVERSIONAPI_KEY"]
response = requests.post(
"https://api.pdfconversionapi.com/v2/convert/kra/to/pdf",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("rocket-sticker.kra", "rb"))],
data={
"MarginHorizontal": "10",
"MarginVertical": "10",
},
timeout=180,
)
result = response.json()
if not response.ok:
raise SystemExit(f"{result['Code']}: {result['Message']}")
os.makedirs("converted", exist_ok=True)
for file in result["Files"]:
path = os.path.join("converted", file["FileName"])
with open(path, "wb") as out:
out.write(base64.b64decode(file["FileData"]))
print(path, file["FileSize"], "bytes")
import { mkdir, readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
const form = new FormData();
const file = "rocket-sticker.kra";
form.append("File", new Blob([await readFile(file)]), file);
form.append("MarginHorizontal", "10");
form.append("MarginVertical", "10");
const url = "https://api.pdfconversionapi.com/v2/convert/kra/to/pdf";
const key = process.env.PDFCONVERSIONAPI_KEY;
const response = await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${key}` },
body: form,
});
const result = await response.json();
if (!response.ok) {
throw new Error(`${result.Code}: ${result.Message}`);
}
await mkdir("converted", { recursive: true });
for (const file of result.Files) {
const path = join("converted", file.FileName);
await writeFile(path, Buffer.from(file.FileData, "base64"));
console.log(path, file.FileSize, "bytes");
}
{
"ConversionCost": 1,
"ConversionTime": 0.028,
"Files": [
{
"FileName": "rocket-sticker.pdf",
"FileExt": "pdf",
"FileSize": 25757,
"FileData": "JVBERi0xLjcKJYCAgIAKMSAw…"
}
]
}Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.
The sample, converted
The same file the code sends. Download the input and the output and compare them yourself.

- Input
- rocket-sticker.kra (108 KB)
- Output
- rocket-sticker.pdf (25 KB)
- Source
- A cartoon rocket sticker on a transparent canvas that we drew and saved as a six-layer KRA file (one layer hidden, one faded by a transparency mask). (CC0-1.0). How it was made
- Made by
- 2026-11-04, API build
9eeeb0640aba
Parameters
Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.
| Parameter | What it does |
|---|---|
MarginHorizontalinteger, default 0 | Space left and right of the art, in millimeters. The sample's 10 mm adds 28.35 pt per side, so the page grows from 240 to 296.69 pt wide.Values: 0–500 (mm) |
MarginVerticalinteger, default 0 | Space above and below. Margins that leave no room on a fixed page (A5 with 80 mm sides) return 400.Values: 0–500 (mm) |
PageSizeenum, default default | A fixed paper size. The art is centered and never enlarged: on A4 the 240 pt sticker sits in the middle of a 595.28 × 841.89 pt page.Values: default, auto, a3, a4, a5, letter, legal |
PageOrientationenum, default default | landscape swaps a fixed size (Letter becomes 792 × 612 pt). Without PageSize it changes nothing.Values: default, portrait, landscape |
Rotateinteger | Turns the art on the page. 90 keeps the square page square; 45 grows the page to 339.41 pt so the turned square fits.Values: -360–360 (degrees, clockwise) |
FileNamestring | Name of the PDF; rocket-sticker.pdf otherwise. |
StoreFileboolean, default false | Returns a link that works for 3 hours instead of inline PDF data. |
What carries over, and what doesn't
Kept
- The merged pixels without recompression: the image is Flate-encoded RGB, and decoding it matched our PNG of the same file exactly
- Transparency, as an 8-bit soft mask the same size as the image
- An embedded ICC profile from the .kra: a test file with a Display P3 profile gave an ICCBased color space holding that profile
- Proportions: the image is centered and scaled down only when the page is too small
Lost or not yet supported
- The 300 ppi printed size. Pages are sized at 96 pixels per inch, so the 320 px sticker is a 240 pt (3.33 inch) page, not 1.07 inches.
- Layers; the PDF holds one merged image.
- Vector content: text and shapes on Krita vector layers are not drawn, so they are not selectable text in the PDF either.
- PDF/A.
Pdfa=trueis accepted but ignored on this route, and the result is a plain PDF 1.7.
Limits
- One KRA, one page per request; canvas up to 100,000,000 pixels, each side at most 300,000 px.
- Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
- Conversions longer than 120 seconds end with 504.
- Margins up to 500 mm per side; Rotate between -360 and 360.
ImageWidth,ColorSpaceandPdfaare not read for PDF output and leave the file unchanged.
Where teams use it
Proofs for print-on-demand stickers
Send the Krita file with margins, and the shop or customer gets a PDF proof with clear space around the sticker. The transparent canvas shows as the page color, not as a black box.
Art in document workflows
When art has to go into a PDF-only workflow, such as a client brief or a pitch pack, converting the .kra directly skips a manual export and keeps the pixels exactly as merged.
Fixed paper sizes
Use PageSize=letter or a4 to place the drawing on standard paper for printing at home or in an office.
Questions
How big is the PDF page?
With no PageSize, the page is the canvas at 96 pixels per inch plus any margins. The 320 × 320 sample is 240 × 240 pt, and with the 10 mm margins it sends, 296.69 pt square.
Is the artwork recompressed as JPEG?
No. The merged image is embedded with lossless Flate compression, plus a soft mask for its alpha. The 25,757-byte sample PDF is close to the 27,925-byte PNG of the same merge.
Can I get PDF/A from a KRA?
Not on this route yet. Pdfa=true returns 200 and an ordinary PDF, without PDF/A metadata. If you need an archive copy, convert the result with a PDF/A tool.
Convert your first KRA file in a minute.