Developer Hub

PDFtoDOC REST API Reference

Programmatically convert PDF documents into formatted Word `.docx` files in under 1 second with our serverless API endpoint.

Endpoint

POST https://api.pdftodoc.com/v1/convertmultipart/form-data

Request Headers

HeaderTypeDescription
AuthorizationStringBearer YOUR_API_KEY
Content-TypeStringmultipart/form-data

Form Parameters

ParameterTypeDescription
fileFileThe PDF document binary (Max 250MB)
formatString"docx" or "doc" (Default: "docx")
cURL Example200 OK — Binary Blob Return
curl -X POST https://api.pdftodoc.com/v1/convert \
  -H "Authorization: Bearer p2d_live_99812739" \
  -F "file=@/path/to/invoice.pdf" \
  -F "format=docx" \
  --output converted_invoice.docx

Node.js SDK Example

import { PDFtoDOC } from '@pdftodoc/sdk';

const client = new PDFtoDOC('p2d_live_99812739');

const docBuffer = await client.convert({
  file: fs.createReadStream('./document.pdf'),
  preserveFormatting: true
});

fs.writeFileSync('output.docx', docBuffer);