# ConvertAPI PDF Tools

> Convert files and web pages to PDF and PDFs to Word, Excel, PowerPoint or images; merge, split, compress, protect, unlock and watermark PDFs; make scans searchable and pull out their text with ConvertAPI.

App · File Conversion · 10 actions. Web page: https://docs.lodol.com/docs/integrations/convertapi-pdf-tools

## Actions

### Add a watermark to a PDF

Stamp text such as DRAFT or CONFIDENTIAL across a PDF's pages. The stamped PDF is saved for later steps to send or store.

**Inputs**

- File (`file`, text, required): The PDF: upload one, pick a file from an earlier step, or paste a public link to one.
- Watermark text (`text`, text, required): The words to stamp. %PAGE% and %PAGES% become the page number and the page count, and %DATE% today's date.
- Pages (`pages`, text): Optional. Which pages to stamp, such as '1-3,7' (the first page is 1). Leave blank to stamp every page.
- Vertical position (`vertical_position`, text): Where the text sits, top to bottom. One of: `top`, `center` (Middle), `bottom`. Default: `center`.
- Horizontal position (`horizontal_position`, text): Where the text sits, left to right. One of: `left`, `center`, `right`. Default: `center`.
- Rotation (`rotation`, number): How far to turn the text, in degrees. 45 is the usual diagonal; 0 is level. From 0 to 360. Default: `45`.
- Font size (`font_size`, number): Size of the text, in points. From 1 to 200. Default: `40`.
- Font colour (`font_color`, text): Colour of the text, as a hex code. Default: `#808080`.
- Opacity (`opacity`, number): How solid the text is, from 1 (barely there) to 100 (fully solid). From 1 to 100. Default: `50`.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/pdf",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "report.pdf",
      "size_bytes": 245118,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "report.pdf",
  "size_bytes": 245118,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Compress a PDF

Shrink a PDF so it fits an email or an upload limit. The smaller PDF is saved for later steps to send or store.

**Inputs**

- File (`file`, text, required): The PDF: upload one, pick a file from an earlier step, or paste a public link to one.
- Compression level (`compression_level`, text): How hard to squeeze. Stronger levels make smaller files by lowering the quality of the PDF's images. One of: `lossless` (Lossless · no visible change, smaller savings), `light` (Light · keeps print quality), `recommended` (Recommended · good quality, much smaller), `strong` (Strong · for email and the web), `extreme` (Extreme · smallest file, images get rough). Default: `recommended`.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/pdf",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "report.pdf",
      "size_bytes": 214366,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "report.pdf",
  "size_bytes": 214366,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Convert a file to PDF

Turn a Word, Excel or PowerPoint file, an image, a text or email file, or a web page into a PDF, saved for later steps to send or store.

**Inputs**

- File (`file`, text, required): What to turn into a PDF: upload a file, pick one from an earlier step, or paste a public link to a file or to a web page.
- Input format (`input_format`, text): Optional. Leave blank to tell from the file's name; a link with no file extension is saved as a web page. Pick one only when the name doesn't show what it is. One of: `web` (Web page (paste its link)), `docx` (Word document), `xlsx` (Excel spreadsheet), `pptx` (PowerPoint presentation), `html` (HTML file), `jpg` (JPG image), `png` (PNG image), `txt` (Plain text), `md` (Markdown), `rtf` (Rich text (.rtf)), `odt` (OpenDocument text (.odt)), `eml` (Email (.eml or .msg)).
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/pdf",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "proposal.pdf",
      "size_bytes": 331902,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "proposal.pdf",
  "size_bytes": 331902,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Convert a PDF

Turn a PDF into an editable Word document, an Excel spreadsheet of its tables, a PowerPoint deck, an image of each page, or an archival PDF/A. Scanned pages are read too.

**Inputs**

- File (`file`, text, required): The PDF: upload one, pick a file from an earlier step, or paste a public link to one.
- Convert to (`output_format`, text, required): What to turn the PDF into. One of: `docx` (Word document (.docx)), `xlsx` (Excel spreadsheet (.xlsx) · the PDF's tables), `pptx` (PowerPoint presentation (.pptx)), `jpg` (JPG images · one per page), `png` (PNG images · one per page), `pdfa` (PDF/A · for long-term archiving). Default: `docx`.
- Pages (`pages`, text): Optional. Which pages to convert, such as '1-3,7' (the first page is 1). Leave blank for every page. PDF/A always keeps every page.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "report.docx",
      "size_bytes": 48213,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "report.docx",
  "size_bytes": 48213,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Extract text from a PDF

Pull the text out of a PDF, reading scanned pages too, for a later step to search, summarise or file. Also saved as a .txt file.

**Inputs**

- File (`file`, text, required): The PDF: upload one, pick a file from an earlier step, or paste a public link to one.
- Pages (`pages`, text): Optional. Which pages to use, such as '1-3,7' (the first page is 1). Leave blank for every page.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `characters` (number): How many characters of text there are.
- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `text` (text): The PDF's text.
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "characters": 42,
  "content_type": "text/plain",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "text/plain",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "invoice.txt",
      "size_bytes": 1284,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "invoice.txt",
  "size_bytes": 1284,
  "status": "success",
  "text": "INVOICE 1042\nAcme Ltd\nTotal due: $1,250.00",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Make a scanned PDF searchable (OCR)

Recognise the text in a scanned PDF so it can be searched and copied. The searchable PDF is saved in place of the scan.

**Inputs**

- File (`file`, text, required): The scanned PDF: upload one, pick a file from an earlier step, or paste a public link to one.
- Language (`language`, text): The language the scan is written in. One of: `ar` (Arabic), `ca` (Catalan), `zh-cn` (Chinese (Simplified)), `zh-tw` (Chinese (Traditional)), `da` (Danish), `nl` (Dutch), `en` (English), `fi` (Finnish), `fa` (French), `de` (German), and 17 more. Default: `en`.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/pdf",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "scan.pdf",
      "size_bytes": 1204663,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "scan.pdf",
  "size_bytes": 1204663,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Merge PDFs

Join several PDFs into one, in the order they are listed. The merged PDF is saved for later steps to send or store.

**Inputs**

- PDFs (`files`, list, required): The PDFs to merge, in order (at least two). Upload them, pick files from earlier steps, or paste public links to them.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/pdf",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "merged.pdf",
      "size_bytes": 512804,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "merged.pdf",
  "size_bytes": 512804,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Password-protect a PDF

Encrypt a PDF so it opens only with a password. The protected PDF is saved for later steps to send or store.

**Inputs**

- File (`file`, text, required): The PDF: upload one, pick a file from an earlier step, or paste a public link to one.
- Password (`password`, text, required): The password the PDF will ask for. Anyone without it can't open the file, so keep a copy somewhere safe.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/pdf",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "contract.pdf",
      "size_bytes": 91744,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "contract.pdf",
  "size_bytes": 91744,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Remove a PDF's password

Take the password off a PDF, or lift its limits on printing and copying, so later steps can read it freely.

**Inputs**

- File (`file`, text, required): The protected PDF: upload one, pick a file from an earlier step, or paste a public link to one.
- Current password (`password`, text): The password the PDF opens with. Leave blank if it opens without one and only printing or copying is locked.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/pdf",
  "conversions_used": 1,
  "document_count": 1,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "statement.pdf",
      "size_bytes": 64310,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "statement.pdf",
  "size_bytes": 64310,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```

### Split a PDF

Cut a PDF into separate files every N pages, at page ranges or at its bookmarks, or take pages out of it. Each resulting PDF is saved for later steps.

**Inputs**

- File (`file`, text, required): The PDF: upload one, pick a file from an earlier step, or paste a public link to one.
- How to split (`split_mode`, text): What to do with the pages. Splitting every N pages or at bookmarks needs nothing else; page ranges and removing pages need the pages they act on. One of: `every` (Split every N pages), `ranges` (Split at page ranges), `bookmarks` (Split at each bookmark (chapter)), `remove` (Remove pages). Default: `every`.
- Pages per file (`pages_per_file`, number): When splitting every N pages: how many pages each file gets. 1 makes a PDF of each page. From 1 to 10000. Default: `1`.
- Page ranges (`ranges`, text): When splitting at page ranges: the pages for each file. '1-3,7' makes one PDF of pages 1 to 3 and another of page 7.
- Join the ranges back together (`merge_after`, true/false): Turn on to get one PDF of just the pages listed in Page ranges, instead of a PDF for each range. Default: `false`.
- Pages to remove (`remove_pages`, text): When removing pages: the pages to take out. '1,8-12' drops those and keeps the rest in one PDF.
- Save as (`filename`, text): Optional. The name to save the result under; the right extension is added for you. When a step makes several files they are numbered, so 'invoice' saves as invoice-1.pdf, invoice-2.pdf and so on.

**Outputs**

- `content_type` (text): The first file's media type.
- `conversions_used` (number): ConvertAPI conversions this used from your plan.
- `document_count` (number): How many files this step saved.
- `document_ref` (text): Reference to the first saved file, for a later step.
- `documents` (list): Every file this step saved, ready to attach or upload.
- `filename` (text): Name of the first saved file.
- `size_bytes` (number): Size of the first file in bytes.
- `status` (text): Status of the action execution ("success" on success).
- `url` (text): Download link for the first file.

**Example output**

```json
{
  "content_type": "application/pdf",
  "conversions_used": 1,
  "document_count": 2,
  "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "report-1.pdf",
      "size_bytes": 88120,
      "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    },
    {
      "content_type": "application/pdf",
      "document_ref": "doc_4f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6",
      "filename": "report-2.pdf",
      "size_bytes": 74905,
      "url": "/actions/core/serve-document/doc_4f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "report-1.pdf",
  "size_bytes": 88120,
  "status": "success",
  "url": "/actions/core/serve-document/doc_3f9c1a7e2b8d4c6fa1e0b5d7c9a2e4f6?teamId=6512a1b2c3d4e5f600000001"
}
```
