HomeDocsAPI Reference › Conversion Endpoints

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.

Info
All conversion endpoints require authentication. Include your 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.

NameTypeRequiredDescription
fileFileYesThe document file to convert. Supported formats: DOCX, XLSX, PPTX, JPG, PNG, TIFF, HTML, RTF, TXT.
outputFileNameStringNoCustom 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.

NameTypeRequiredDescription
imageFilesFile[]YesOne or more image files. Supported formats: JPEG, PNG, BMP, WebP.
outputFileNameStringYesName for the output PDF file.
pageSizeStringNoPage dimensions: A4 (default), Letter, A5, HalfLetter, SameAsImage.
orientationStringNoPortrait (default) or Landscape.
marginSizeStringNoSmall (default), Large, or None.
applyOcrBooleanNoSet 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.

NameTypeRequiredDescription
fileFileYesThe Word document to convert (.doc or .docx).
outputFileNameStringNoCustom 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.

NameTypeRequiredDescription
fileFileYesThe Excel spreadsheet to convert (.xls or .xlsx).
outputFileNameStringNoCustom 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.

NameTypeRequiredDescription
fileFileYesThe PowerPoint presentation to convert (.ppt or .pptx).
outputFileNameStringNoCustom 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.

NameTypeRequiredDescription
fileFileYesThe image file to convert (.jpg, .jpeg, .png, .tiff, .tif, .bmp, .gif, .webp).
outputFileNameStringNoCustom name for the output PDF file.
pageSizeStringNoPage size for the output PDF. Options: fit (default), A4, Letter, Legal.
orientationStringNoPage 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.

NameTypeRequiredDescription
fileFileYesThe PDF file to convert.
outputFileNameStringNoCustom name for the output Word file.
passwordStringNoPassword 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.

NameTypeRequiredDescription
fileFileYesThe PDF file to convert.
outputFileNameStringNoCustom name for the output Excel file.
pagesStringNoPage range to convert (e.g., 1-5, 1,3,5). Defaults to all pages.
passwordStringNoPassword 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.

NameTypeRequiredDescription
fileFileYesThe PDF file to convert.
outputFileNameStringNoCustom name for the output PowerPoint file.
passwordStringNoPassword 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.

NameTypeRequiredDescription
fileFileYesThe PDF file to convert.
outputFileNameStringNoCustom base name for the output image files.
formatStringNoImage format: jpg (default), png, tiff, bmp.
qualityStringNoImage quality: Low (150 DPI), Medium (300 DPI, default), High (600 DPI).
pagesStringNoPage range to convert (e.g., 1-5, 1,3,5). Defaults to all pages.
passwordStringNoPassword 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.

NameTypeRequiredDescription
fileFileYesThe PDF file to convert.
outputFileNameStringNoCustom name for the output PDF/A file.
conformanceStringNoPDF/A conformance level: pdfa-1b (default), pdfa-1a, pdfa-2b, pdfa-2a, pdfa-2u, pdfa-3b, pdfa-3a, pdfa-3u.
passwordStringNoPassword 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.

NameTypeRequiredDescription
fileFileYesThe PDF file to convert.
outputFileNameStringNoCustom name for the output file.
formatStringNoOutput format: html (default) or epub.
embedImagesBooleanNoEmbed images as base64 in the HTML. Default: false.
pagesStringNoPage range to convert (e.g., 1-5). Defaults to all pages.
passwordStringNoPassword 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