Skip to content
pdfconversionapi

PDN to ICO API

POST a .pdn to /v2/convert/pdn/to/ico and get an icon holding one 32-bit image of the merged layers, stored as PNG inside the ICO. The sample asks for 96 px and gets a 96 × 64 icon; without a size the sign is fitted into 256 × 256.

Endpoint
POST /v2/convert/pdn/to/ico
Accepts
pdn
Sample timing
24 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/ico \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@lemonade-stand-sign.pdn \
  --form-string ImageWidth=96 \
  -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
fi
200 OK24 ms median1 file, 14 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.024,
  "Files": [
    {
      "FileName": "lemonade-stand-sign.ico",
      "FileExt": "ico",
      "FileSize": 14203,
      "FileData": "AAABAAEAYEAAAAAAIABlNwAA…"
    }
  ]
}

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.

First page of lemonade-stand-sign.ico, rendered by the API
Input
lemonade-stand-sign.pdn (87 KB)
Output
lemonade-stand-sign.ico (14 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.

ParameterWhat it does
ImageWidthintegerIcon width. The sample sends 96 and gets 96 × 64 in 14,203 bytes. Larger values are capped: 720 still gave 256 × 171.Values: 1–20000
ImageHeightintegerIcon height; together with ImageWidth, a box. 240 × 240 gave a 240 × 160 icon.Values: 1–20000
ScaleProportionsboolean, default truefalse stretches to both sizes, the way to get a square icon from a 3:2 canvas: 240 × 240 exactly.
ScaleIfLargerboolean, default falsetrue leaves a canvas that is smaller than the requested size alone.
ScaleImageboolean, default truefalse crops the top-left area: 180 × 90 gave an icon of the board's corner and the letters LEMON.
ColorSpaceenum, default defaultgray (57,737 bytes at 256 px) or monochrome (5,605 bytes, with color values only black or white) colors; the icon stays RGBA with clear corners.Values: default, rgb, gray, monochrome (also srgb, truecolors, grayscale); cmyk returns 400
FileNamestringName of the icon file: FileName=favicon returns favicon.ico.
StoreFileboolean, default falsetrue returns a 3-hour link in place of base64.

What carries over, and what doesn't

Kept

  • Transparency: the icon image is 8-bit RGBA, and 76 pixels at the rounded corners of the 96 × 64 sample are fully clear
  • The merged look of all visible layers, scaled with a Lanczos3 filter after merging
  • The 3:2 shape of the canvas, unless you set both sizes with ScaleProportions=false

Lost or not yet supported

  • More than one size. Each request gives one image; ask once per size.
  • A square shape for a non-square canvas: the sign gives 256 × 171 by default.
  • Small text at small sizes: at 96 × 64 the 'Refills 25 cents' line can no longer be read, while LEMONADE and the price can.

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.
  • One image per icon, at most 256 × 256 pixels.

Where teams use it

Favicons drawn in Paint.NET

A small logo or pixel-art mark drawn on a square, clear Paint.NET canvas can go straight to favicon.ico with ImageWidth=32 or 48, keeping its transparent background.

Shortcut and tray icons

Windows shortcuts, installers and tray apps use .ico files. ImageWidth=256 gives the largest size one ICO entry can hold.

Questions

How many sizes does the .ico hold?

One. The sample holds a single 96 × 64 image. For 16, 32 and 48 px versions, make one request per size and join them with an icon tool.

Will the icon be transparent?

Yes, wherever the merged canvas is. The icon stores 8-bit RGBA, so the sign's rounded corners are clear and its anti-aliased edge stays soft.

Why is my icon not square?

The canvas proportions are kept: 360 × 240 becomes 256 × 171. Make the Paint.NET canvas square, or send ImageWidth, ImageHeight and ScaleProportions=false to stretch it.

What format is the image inside the icon?

PNG. The ICO directory has one 32-bit entry whose data starts with the PNG signature. A program that only reads bitmap entries will not show it.

Convert your first PDN file in a minute.