Create Image from PDF
Image → Create Image from PDF
The Create Image from PDF API converts PDF pages to images. Send the PDF as Base64 (docContent), the file name (docname), and—when you care which pages run—fill pageNrs with one line of text the same way you would in the Power Automate Page Number field (all, 1,2-3,5,7-, -2, and so on). imageAction and async are optional extras. The Parameters tab has the same quick guide, examples, and practical notes as the integration docs.
Try the Create Image from PDF API
:::note Quick reference
Endpoint: POST /api/v2/CreateImages · Required: api-key, docContent, docname
:::
:::info Try it live Use the form below to send your API key and PDF (Base64). Optionally set page range or image action; the response is JSON with image data. No code required—fill the fields and click Send request. :::
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Create Image from PDF?
This endpoint converts PDF pages to images. You provide the PDF (Base64), docname, and optionally pageNrs as one string—plain numbers, commas, ranges, and keywords like all (see the Parameters tab for the full pattern list and a 12-page example table). You can also send imageAction for width, format, or advanced page selection. The response is a JSON array of images (Base64) with file names and page info. Supported output formats include jpeg, png, bmp, gif, tiff, and others.
Key features
- Page selection – Type
pageNrsas one line of text (same patterns as the Power Automate Page Number field:all, a lone*,last,first,0,1, commas, ranges,7-,-1,-2, …). Optional imageAction for width, format, or alternate page selection. - Format and size – imageAction can set WidthPixel and ImageExtension (jpeg, png, bmp, gif, tif, etc.).
- Async – Use async for large PDFs.
:::tip Best for Use when you need thumbnails or images from PDF pages. Combine with Compress Image or Resize Image for thumbnails. :::
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | Yes | PDF file content (Base64). |
| docname | string | Yes | PDF file name (e.g. sample.pdf). |
| pageNrs | string | No | Pages to convert—one line of text: numbers, commas, hyphens, and keywords (all, a lone *, last, first, 0, 1, -1, -2, …). Same patterns as the Power Automate Page Number field. See the tip and example table below. |
| imageAction | object | No | WidthPixel, ImageExtension, PageSelection (JSON). |
| async | boolean | No | Enable asynchronous processing. |
:::tip How to fill pageNrs
- Type
allto convert every page. A lone*(asterisk) does the same job if you prefer it. lastis only the final page.first,0, or plain1all mean “just the first page.”0is simply another way to say page 1; after that you still count 2, 3, 4…-1is the last page.-2is the page before that (on a 12-page file that is page 11).- Commas let you stitch pieces together.
1,2-3,5,7-reads as: page 1, pages 2 through 3, page 5, then page 7 all the way to the end. The empty spot after7-is what tells the service “run to the last page.”
:::
:::info Why we show 1,2-3,5,7- instead of 0,1-2,5,7-
0,1-2,5,7- is legal, but 0 and 1-2 both include page 1, so you can accidentally render the first page twice. 1,2-3,5,7- says the same kind of thing with less overlap.
:::
Example strings (picture a 12-page PDF)
| What you type | What you get |
|---|---|
1,2-3,5,7- | Page 1, pages 2–3, page 5, then pages 7–12 |
all | Pages 1 through 12 |
* | Same as all |
-1 | Page 12 (last) |
-2 | Page 11 (second from the end) |
last | Page 12 only |
first | Page 1 only |
0 | Page 1 only (same idea as first) |
Practical notes
7-with nothing after the dash means “from page 7 through the last page.”- Page numbers that do not exist are ignored.
7-3(backwards) still keeps page 7 from that chunk when page 7 exists; do not expect pages 6 and 5 from that piece.- Listing the same page more than once is allowed—each mention can produce another image.
When to use Create Image from PDF
- Thumbnails – Generate preview images from PDF pages.
- Web and apps – Use images instead of embedded PDF viewers.
- Pipelines – Convert pages to images for Compress Image, Resize Image, or OCR.
:::info Need the full API? For request/response schemas and code samples, see Create Image from PDF in the PDF4me API docs. :::
Prerequisites
Before using this endpoint, make sure you have:
- A valid PDF4me API key (Get your API Key)
- A PDF file in Base64 format
Response Format
The API returns a JSON response containing an array of converted images, each with:
- Image content (base64 encoded)
- Image file name
- Page number information