Maton

PDF.co

Access the PDF.co API with managed authentication. Convert, merge, split, and edit PDFs with full document manipulation capabilities.

Reference

PDF Information

Get metadata and information about a PDF file.

POST /pdf-co/v1/pdf/info
Content-Type: application/json

{
  "url": "https://example.com/document.pdf"
}

Convert PDF to Text

POST /pdf-co/v1/pdf/convert/to/text
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "0-",
  "inline": true
}

Response:

{
  "body": "Extracted text content...",
  "pageCount": 5,
  "error": false,
  "status": 200,
  "name": "document.txt",
  "credits": 10,
  "remainingCredits": 9990
}

Convert PDF to CSV

POST /pdf-co/v1/pdf/convert/to/csv
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "0-",
  "inline": true,
  "lang": "eng"
}

Convert PDF to JSON

POST /pdf-co/v1/pdf/convert/to/json
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "0-",
  "inline": true
}

Convert PDF to HTML

POST /pdf-co/v1/pdf/convert/to/html
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "0-",
  "name": "output.html"
}

Convert PDF to XLSX (Excel)

POST /pdf-co/v1/pdf/convert/to/xlsx
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "0-",
  "name": "output.xlsx"
}

Convert PDF to PNG

POST /pdf-co/v1/pdf/convert/to/png
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "0",
  "name": "page.png"
}

Convert PDF to JPG

POST /pdf-co/v1/pdf/convert/to/jpg
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "0",
  "name": "page.jpg"
}

Convert HTML to PDF

POST /pdf-co/v1/pdf/convert/from/html
Content-Type: application/json

{
  "html": "<html><body><h1>Hello World</h1></body></html>",
  "name": "output.pdf",
  "paperSize": "Letter",
  "orientation": "Portrait",
  "margins": "10 10 10 10"
}

Response:

{
  "url": "https://pdf-temp-files.s3.amazonaws.com/...",
  "pageCount": 1,
  "error": false,
  "status": 200,
  "name": "output.pdf",
  "remainingCredits": 9980
}

Convert URL to PDF

POST /pdf-co/v1/pdf/convert/from/url
Content-Type: application/json

{
  "url": "https://example.com",
  "name": "webpage.pdf",
  "paperSize": "A4",
  "orientation": "Portrait"
}

Merge PDFs

Combine multiple PDFs into a single document.

POST /pdf-co/v1/pdf/merge
Content-Type: application/json

{
  "url": "https://example.com/doc1.pdf,https://example.com/doc2.pdf",
  "name": "merged.pdf"
}

Response:

{
  "url": "https://pdf-temp-files.s3.amazonaws.com/merged.pdf",
  "pageCount": 10,
  "error": false,
  "status": 200,
  "name": "merged.pdf",
  "remainingCredits": 9970,
  "duration": 1500
}

Split PDF

Split a PDF into multiple files.

POST /pdf-co/v1/pdf/split
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "1-3,4-6,7-"
}

Response:

{
  "urls": [
    "https://pdf-temp-files.s3.amazonaws.com/part1.pdf",
    "https://pdf-temp-files.s3.amazonaws.com/part2.pdf",
    "https://pdf-temp-files.s3.amazonaws.com/part3.pdf"
  ],
  "pageCount": 10,
  "error": false,
  "status": 200,
  "remainingCredits": 9960
}

Delete Pages

POST /pdf-co/v1/pdf/edit/delete-pages
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "pages": "2,4,6"
}

Add Text and Images

Add text, images, or other content to a PDF.

POST /pdf-co/v1/pdf/edit/add
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "name": "annotated.pdf",
  "annotations": [
    {
      "text": "CONFIDENTIAL",
      "x": 100,
      "y": 100,
      "size": 24,
      "pages": "0-"
    }
  ]
}

Search and Replace Text

POST /pdf-co/v1/pdf/edit/replace-text
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "searchString": "old text",
  "replaceString": "new text"
}

Search and Delete Text

POST /pdf-co/v1/pdf/edit/delete-text
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "searchString": "text to remove"
}

Add Password

POST /pdf-co/v1/pdf/security/add
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "ownerPassword": "owner123",
  "userPassword": "user456"
}

Remove Password

POST /pdf-co/v1/pdf/security/remove
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "password": "currentpassword"
}

AI Invoice Parser

Automatically extract structured data from invoices.

POST /pdf-co/v1/ai-invoice-parser
Content-Type: application/json

{
  "url": "https://example.com/invoice.pdf"
}

Document Parser

Extract data using templates.

POST /pdf-co/v1/pdf/documentparser
Content-Type: application/json

{
  "url": "https://example.com/document.pdf",
  "templateId": "your-template-id"
}

Generate Barcode

POST /pdf-co/v1/barcode/generate
Content-Type: application/json

{
  "value": "1234567890",
  "type": "QRCode",
  "name": "barcode.png"
}

Read Barcode

POST /pdf-co/v1/barcode/read/from/url
Content-Type: application/json

{
  "url": "https://example.com/barcode.png",
  "types": "QRCode,Code128,Code39,EAN13,UPCA"
}

Check Job Status (Async)

For async operations, check job status.

POST /pdf-co/v1/job/check
Content-Type: application/json

{
  "jobId": "abc123"
}

Resources

On this page