Skip to content
pdfconversionapi

PUB to JPG API

POST /v2/convert/pub/to/jpg returns a JPEG for each page of a Microsoft Publisher file. The sample asks for ImageResolution=100, so the two Letter pages of our flyer come back 850 × 1,100 pixels, 113,742 and 58,659 bytes, with 100 DPI recorded.

Endpoint
POST /v2/convert/pub/to/jpg
Accepts
pub
Sample timing
0.534 s 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/pub/to/jpg \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@book-sale-flyer.pub \
  --form-string ImageResolution=100 \
  -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 OK0.534 s median2 files, 168 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.534,
  "Files": [
    {
      "FileName": "book-sale-flyer-1.jpg",
      "FileExt": "jpg",
      "FileSize": 113742,
      "FileData": "/9j/4AAQSkZJRgABAgEAZABk…"
    },
    {
      "FileName": "book-sale-flyer-2.jpg",
      "FileExt": "jpg",
      "FileSize": 58659,
      "FileData": "/9j/4AAQSkZJRgABAgEAZABk…"
    }
  ]
}

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 book-sale-flyer-1.jpg, rendered by the API
Input
book-sale-flyer.pub (10 KB)
Output
book-sale-flyer-1.jpg (111 KB)book-sale-flyer-2.jpg (57 KB)
Source
A two-page flyer for a fictional library book sale; we wrote our text and shapes into a small Publisher test file from an open-source office suite's test data (MPL-2.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
ImageResolutioninteger, default 150DPI of each page, also the density written into the JPEG. At 150 the front page is 1,275 × 1,650 and 207,607 bytes.Values: 36–600
ImageQualityinteger, default 85JPEG quality; ConvertAPI documents 75 as its default for Publisher files. The front page at 150 DPI was 207,607 bytes at 85 and 147,262 at 60.Values: 1–100
ImageWidthintegerWidth in pixels.Values: 1–20000
ImageHeightintegerHeight in pixels; with a width, an 850 × 850 box gave 657 × 850.Values: 1–20000
ScaleProportionsboolean, default truefalse fills the box exactly (850 × 850), stretching the flyer.
ScaleImageboolean, default truefalse crops the top-left corner instead of scaling.
ScaleIfLargerboolean, default falsetrue keeps a page from growing past its 150 DPI size.
ColorSpaceenum, default defaultgray writes one channel: the volunteer page at 100 DPI was 38,894 bytes.Values: default, rgb, gray, monochrome
PageRangestringPages to convert, for example 1.
FileNamestringStem for -1.jpg, -2.jpg.
StoreFileboolean, default falseReturn 3-hour links instead of the files.

Not supported yet

Setting one of these to anything but its default returns 400.

OptionWhat to do instead
JpgTypeOutput is always a color baseline JPEG unless ColorSpace=gray; jpeggray returns 400 "JpgType is not supported yet for PUB → JPG".
ImageResolutionH, ImageResolutionVUse ImageResolution.

Also refused when set: TextAntialiasing, GraphicsAntialiasing, UseCIEColor.

What carries over, and what doesn't

Kept

  • Each page's US Letter proportions, 850 × 1,100 at 100 DPI
  • Colors of fills, outlines and text, flattened onto the white page
  • The DPI as JPEG density: the sample files record 100 × 100

Lost or not yet supported

  • Transparency: TransparentColor is accepted and changes nothing (the volunteer page stayed 113,628 bytes at 150 DPI).
  • The font faces named in the file, as on every Publisher route.
  • Exact pixels, since JPEG compresses with loss.

Limits

  • JpgType, ImageResolutionH, ImageResolutionV, TextAntialiasing, GraphicsAntialiasing and UseCIEColor return 400 unless sent with ConvertAPI's defaults.
  • 100,000,000 pixels and 16,000 pixels per side per page.
  • Up to 10 MB on the Free plan or 100 MB on paid plans per request and 120 seconds per conversion.

Where teams use it

Posting a flyer online

Event pages and community boards that take JPEG uploads can show the flyer as an image; 100 DPI keeps a Letter page under 120 KB in the sample.

Email previews of a newsletter

Send the front page as an inline JPEG with a link to the full PDF.

Gray proofs

ColorSpace=gray gives one-channel pages for a black-and-white proof print.

Questions

Why did `ImageResolutionH=300` fail?

This route reads one resolution for both directions, ImageResolution. The separate H and V values aren't read yet, so a value other than 200 returns 400 "ImageResolutionH is not supported yet for PUB → JPG".

How do ConvertAPI's defaults compare?

ConvertAPI documents quality 75 and 200 DPI for this pair. Ours are 85 and 150; send ImageQuality=75 and ImageResolution=200 to match.

Can I get gray JPEGs?

Yes, ColorSpace=gray. JpgType=jpeggray isn't read yet and returns 400.

Convert your first PUB file in a minute.