PDN to PDF API
POST a .pdn to /v2/convert/pdn/to/pdf and get a one-page PDF with the merged layers as a lossless image plus a soft mask for its transparency. The sample adds 10 mm margins, so the 360 × 240 sign sits on a 326.69 × 236.69 pt page.
- Endpoint
- POST /v2/
convert/ pdn/ to/ pdf - Accepts
- pdn
- Sample timing
- 26 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/pdn/to/pdf \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@lemonade-stand-sign.pdn \
--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/pdn/to/pdf",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("lemonade-stand-sign.pdn", "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 = "lemonade-stand-sign.pdn";
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/pdn/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.026,
"Files": [
{
"FileName": "lemonade-stand-sign.pdf",
"FileExt": "pdf",
"FileSize": 32426,
"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
- lemonade-stand-sign.pdn (87 KB)
- Output
- lemonade-stand-sign.pdf (32 KB)
- Source
- A 360 x 240 price sign with rounded transparent corners that we drew and wrote as a layered PDN file ourselves: seven layers, including Overlay and Multiply blend modes, a semi-transparent shine and a hidden draft layer. (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 | Blank space left and right, in whole millimeters; the sample's 10 mm is 28.35 pt a side. Without PageSize the page grows by the margins. On a fixed sheet they shrink the sign only when it would not fit between them.Values: 0–500 (mm) |
MarginVerticalinteger, default 0 | Blank space above and below. On landscape A5 with 60 mm on every side the sign shrank to 119.06 × 79.37 pt; 110 mm on portrait A5 left no room and got 400.Values: 0–500 (mm) |
PageSizeenum, default default | Sheet for the page. default and auto use the sign's own size, 270 × 180 pt. a5 gave a 419.53 × 595.28 pt page with the sign centered, never enlarged.Values: default, auto, a3, a4, a5, letter, legal |
PageOrientationenum, default default | landscape swaps the sheet's sides: A5 became 595.28 × 419.53 pt. Without PageSize it returned the same PDF as no parameters.Values: default, portrait, landscape |
Rotateinteger | Turns the sign clockwise. Rotate=90 gave a 180 × 270 pt page with the sign on its side; 30 gave a 323.83 × 290.88 pt page around the tilted sign. none or empty keeps it level.Values: -360 to 360, whole degrees |
FileNamestring | Base name of the result; without it the file comes back as lemonade-stand-sign.pdf. |
StoreFileboolean, default false | true returns a link to the PDF, valid for 3 hours. |
What carries over, and what doesn't
Kept
- Every merged pixel: decoded, the image in the PDF has exactly the RGB values of the PNG route's output
- Transparency, as a soft mask equal to the merged alpha, so the rounded corners show the page through them
- The 3:2 proportions at 96 pixels per inch: the 360 × 240 px sign is drawn 270 × 180 pt
Lost or not yet supported
- Size on bigger sheets. The image is never scaled up: on landscape A5 the sign covers 270 × 180 of 595.28 × 419.53 pt.
- Layers, and the hidden draft layer, which is left out.
- PDF/A.
Pdfa=trueis not read on this route, and the result is an ordinary PDF 1.7.
Limits
- One PDN per request, merged canvas up to 100,000,000 pixels.
- Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
- 120 seconds per conversion, then 504.
- Margins in whole millimeters from 0 to 500 and
Rotatein whole degrees from -360 to 360; a margin of 2.5 returns 400. ImageWidth,ImageQuality,ColorSpace,AlphaColorandPdfaare not read: each gave the same 32,405-byte PDF as no parameters.
Where teams use it
Printing signs and flyers
Notices, price signs and flyers drawn in Paint.NET can go to a printer or a print service as PDF. PageSize picks the sheet, and the margin settings keep a blank border around the artwork.
Attachments for documents and tickets
Reports, forms and support tickets often accept PDF attachments but not .pdn files. The PDF carries the merged picture without recompressing it.
Questions
How large is the PDF page?
Without PageSize, the sign's size at 96 px per inch plus the margins: 270 × 180 pt for the sign alone, 326.69 × 236.69 pt with the sample's 10 mm on each side. With a sheet such as A5 or Letter, the page takes the sheet's size and the sign is centered on it.
Do the transparent corners stay transparent?
Yes. The image has a soft mask holding the same alpha as the merged layers, so the rounded corners and soft edge show the page beneath. Nothing is filled in with white.
Can I put the sign in portrait?
Send Rotate=90, or -90 to turn the other way. The page becomes 180 × 270 pt with the sign on its side. With PageSize=letter as well, the turned sign is centered on the 612 × 792 pt sheet.
Is the image recompressed?
No. It is stored with lossless compression at 360 × 240 pixels, beside its 8-bit soft mask. Decoded, both matched the PNG route's output.
Convert your first PDN file in a minute.