Conversion Endpoints
Convert files to and from PDF using the REST API.
Overview
The conversion endpoints allow you to convert documents between PDF and other formats including
Word, Excel, PowerPoint, images, HTML, and PDF/A. All endpoints accept file uploads via
multipart/form-data and return the converted file in the response body.
X-Api-Key and X-Api-Secret headers on every request. See Authentication for details.
General Convert to PDF
POST /api/pdf/convert
Converts a wide range of document formats to PDF. The API automatically detects the input format based on the file extension and content type.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The document file to convert. Supported formats: DOCX, XLSX, PPTX, JPG, PNG, TIFF, HTML, RTF, TXT. |
outputFileName | String | No | Custom name for the output PDF file. Defaults to the input filename with a .pdf extension. |
curl -X POST https://pdf.mapsoft.com/api/pdf/convert \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@document.docx" \
-F "outputFileName=converted.pdf" \
-o converted.pdf
Scan to PDF
POST /api/pdf/scan-to-pdf
Convert multiple images (e.g., photos of document pages) into a single multi-page PDF. Optionally apply OCR to make the scanned text searchable. Maximum request size: 100 MB.
| Name | Type | Required | Description |
|---|---|---|---|
imageFiles | File[] | Yes | One or more image files. Supported formats: JPEG, PNG, BMP, WebP. |
outputFileName | String | Yes | Name for the output PDF file. |
pageSize | String | No | Page dimensions: A4 (default), Letter, A5, HalfLetter, SameAsImage. |
orientation | String | No | Portrait (default) or Landscape. |
marginSize | String | No | Small (default), Large, or None. |
applyOcr | Boolean | No | Set to true to run OCR on the output PDF. Default: false. |
Example Request
curl -X POST https://pdf.mapsoft.com/api/pdf/scan-to-pdf \
-H "X-Api-Key: YOUR_KEY" \
-H "X-Api-Secret: YOUR_SECRET" \
-F "imageFiles=@page1.jpg" \
-F "imageFiles=@page2.jpg" \
-F "outputFileName=scanned-document.pdf" \
-F "pageSize=A4" \
-F "applyOcr=true" \
-o scanned-document.pdf
Word to PDF
POST /api/pdf/word-to-pdf
Converts a Microsoft Word document (.doc or .docx) to PDF with high-fidelity layout preservation.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The Word document to convert (.doc or .docx). |
outputFileName | String | No | Custom name for the output PDF file. |
curl -X POST https://pdf.mapsoft.com/api/pdf/word-to-pdf \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@report.docx" \
-o report.pdf
Excel to PDF
POST /api/pdf/excel-to-pdf
Converts a Microsoft Excel spreadsheet (.xls or .xlsx) to PDF. All worksheets are included by default.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The Excel spreadsheet to convert (.xls or .xlsx). |
outputFileName | String | No | Custom name for the output PDF file. |
curl -X POST https://pdf.mapsoft.com/api/pdf/excel-to-pdf \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@spreadsheet.xlsx" \
-o spreadsheet.pdf
PowerPoint to PDF
POST /api/pdf/powerpoint-to-pdf
Converts a Microsoft PowerPoint presentation (.ppt or .pptx) to PDF. Each slide becomes a page in the output PDF.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The PowerPoint presentation to convert (.ppt or .pptx). |
outputFileName | String | No | Custom name for the output PDF file. |
curl -X POST https://pdf.mapsoft.com/api/pdf/powerpoint-to-pdf \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@presentation.pptx" \
-o presentation.pdf
Images to PDF
POST /api/pdf/convert-jpeg-to-pdf
Converts an image file to a PDF document. Supports JPEG, PNG, TIFF, BMP, GIF, and WebP formats. The image is placed on a page sized to fit the image dimensions.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The image file to convert (.jpg, .jpeg, .png, .tiff, .tif, .bmp, .gif, .webp). |
outputFileName | String | No | Custom name for the output PDF file. |
pageSize | String | No | Page size for the output PDF. Options: fit (default), A4, Letter, Legal. |
orientation | String | No | Page orientation: auto (default), portrait, landscape. |
curl -X POST https://pdf.mapsoft.com/api/pdf/convert-jpeg-to-pdf \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@photo.jpg" \
-F "pageSize=A4" \
-F "orientation=portrait" \
-o photo.pdf
PDF to Word
POST /api/pdf/convert-to-word
Converts a PDF document to Microsoft Word format (.docx) with layout and formatting preserved as closely as possible.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The PDF file to convert. |
outputFileName | String | No | Custom name for the output Word file. |
password | String | No | Password to open the PDF, if it is password-protected. |
curl -X POST https://pdf.mapsoft.com/api/pdf/convert-to-word \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@document.pdf" \
-o document.docx
PDF to Excel
POST /api/pdf/convert-to-excel
Converts a PDF document containing tables to Microsoft Excel format (.xlsx). Tables are detected automatically and placed into worksheets.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The PDF file to convert. |
outputFileName | String | No | Custom name for the output Excel file. |
pages | String | No | Page range to convert (e.g., 1-5, 1,3,5). Defaults to all pages. |
password | String | No | Password to open the PDF, if it is password-protected. |
curl -X POST https://pdf.mapsoft.com/api/pdf/convert-to-excel \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@tables.pdf" \
-F "pages=1-3" \
-o tables.xlsx
PDF to PowerPoint
POST /api/pdf/convert-to-powerpoint
Converts a PDF document to Microsoft PowerPoint format (.pptx). Each PDF page becomes a slide.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The PDF file to convert. |
outputFileName | String | No | Custom name for the output PowerPoint file. |
password | String | No | Password to open the PDF, if it is password-protected. |
curl -X POST https://pdf.mapsoft.com/api/pdf/convert-to-powerpoint \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@slides.pdf" \
-o slides.pptx
PDF to Images
POST /api/pdf/convert-to-images
Converts each page of a PDF document to an image. Returns a ZIP archive containing one image per page.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The PDF file to convert. |
outputFileName | String | No | Custom base name for the output image files. |
format | String | No | Image format: jpg (default), png, tiff, bmp. |
quality | String | No | Image quality: Low (150 DPI), Medium (300 DPI, default), High (600 DPI). |
pages | String | No | Page range to convert (e.g., 1-5, 1,3,5). Defaults to all pages. |
password | String | No | Password to open the PDF, if it is password-protected. |
curl -X POST https://pdf.mapsoft.com/api/pdf/convert-to-images \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@document.pdf" \
-F "format=png" \
-F "dpi=300" \
-F "pages=1-5" \
-o images.zip
Convert to PDF/A
POST /api/pdf/convert-to-pdfa
Converts a PDF document to PDF/A format for long-term archival. Embeds fonts, removes transparency, and ensures compliance with the selected PDF/A standard.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The PDF file to convert. |
outputFileName | String | No | Custom name for the output PDF/A file. |
conformance | String | No | PDF/A conformance level: pdfa-1b (default), pdfa-1a, pdfa-2b, pdfa-2a, pdfa-2u, pdfa-3b, pdfa-3a, pdfa-3u. |
password | String | No | Password to open the PDF, if it is password-protected. |
curl -X POST https://pdf.mapsoft.com/api/pdf/convert-to-pdfa \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@document.pdf" \
-F "conformance=pdfa-2b" \
-o document-pdfa.pdf
Convert to HTML/EPUB
POST /api/pdf/convert-to-html
Converts a PDF document to HTML or EPUB format. Images and stylesheets are bundled into a ZIP archive.
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The PDF file to convert. |
outputFileName | String | No | Custom name for the output file. |
format | String | No | Output format: html (default) or epub. |
embedImages | Boolean | No | Embed images as base64 in the HTML. Default: false. |
pages | String | No | Page range to convert (e.g., 1-5). Defaults to all pages. |
password | String | No | Password to open the PDF, if it is password-protected. |
curl -X POST https://pdf.mapsoft.com/api/pdf/convert-to-html \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-F "file=@document.pdf" \
-F "format=html" \
-F "embedImages=true" \
-o document.zip