Convert to PDF
Convert → Convert to PDF
The Convert to PDF API converts many document types into PDF. You send the document as Base64 (docContent), docName (output name without extension), IsAsync, and optionally document with Name (original source file name with extension, e.g. report.xlsx). Supports 50+ formats (Word, Excel, PowerPoint, images, and more). The API returns the PDF (or 202 + Location for async). Use the tester below to try it; more details are in the sections that follow.
Try the Convert to PDF API
Endpoint: POST /api/v2/ConvertToPdf · Required: api-key, docContent, docName, IsAsync · Optional: document (object with Name)
Use the form below to send your API key and document (Base64). The response is the PDF (or polling URL when async). No code required—fill the fields and click Send request.
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Convert to PDF?
This endpoint converts a wide range of document formats into PDF. You provide the document (Base64), docName (output name), IsAsync, and optionally document with Name for the source file name (with extension). Supported formats include Word, Excel, PowerPoint, images, and 50+ other types. The API returns the PDF or a Location URL for async polling.
Key features
- 50+ formats – Word, Excel, PowerPoint, images, and many other document types.
- Single request – Send docContent, docName, IsAsync; optional document
{ "Name": "file.ext" }for source metadata; no format parameter needed (detected from content). - Async – IsAsync returns 202 with Location URL for polling.
Use when you have a document in another format and need a PDF. For specific conversions see Convert PDF to Word, Convert HTML to PDF, or Convert Markdown to PDF.
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | Yes | Document file content (Base64). Word, Excel, PowerPoint, image, etc. |
| docName | string | Yes | Output name (e.g. output; extension not required). |
| document | object | No | Optional. { "Name": "source.ext" } — original source file name with extension. |
| IsAsync | boolean | Yes | Enable asynchronous processing. |
When to use Convert to PDF
- Office documents – Convert Word, Excel, PowerPoint to PDF.
- Images – Convert image files to PDF.
- Batch – Use for many different source formats in one workflow.
For request/response schemas and code samples, see Convert to 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 document file in Base64 format (Word, Excel, PowerPoint, image, etc.)
Response Format
The API returns a PDF document:
- Status 200: Document to PDF conversion completed immediately - binary PDF content in response body
- Status 202: Request accepted and processing asynchronously - use the Location header URL to poll for results
For asynchronous requests, poll the Location URL until status 200 is returned with the PDF document.