# iLovePDF

> Compress, merge, split, convert, protect and watermark PDFs with iLovePDF.

App · File Conversion · 9 actions. Web page: https://docs.lodol.com/docs/integrations/ilovepdf

## Actions

### Add a watermark to a PDF

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

**Inputs**

- File (`file`, text, required): The PDF to stamp: upload one, pick a file from an earlier step, or paste a public PDF URL.
- Watermark text (`text`, text, required): The text to stamp on the page.
- Pages (`pages`, text): Which pages to stamp. 'all' stamps every page; otherwise give pages and ranges such as '1,4,8-12'. Default: `all`.
- Vertical position (`vertical_position`, text): Where on the page the text sits, top to bottom. One of: `top`, `middle`, `bottom`. Default: `middle`.
- Horizontal position (`horizontal_position`, text): Where on the page 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 gives the usual diagonal watermark. From 0 to 360. Default: `0`.
- Font size (`font_size`, number): Size of the text, in points. From 1 to 200. Default: `14`.
- Font colour (`font_color`, text): Colour of the text, as a hex code. Default: `#000000`.
- Opacity (`transparency`, number): How solid the text is, from 1 (barely visible) to 100 (fully opaque). From 1 to 100. Default: `100`.
- Tile across the page (`mosaic`, true/false): Turn on to repeat the text nine times per page. This overrides the position settings. Default: `false`.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_count": 1,
  "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "report_watermarked.pdf",
      "size_bytes": 245118,
      "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "report_watermarked.pdf",
  "size_bytes": 245118,
  "task_id": "g27d4mrsg3ztmnzagm5d",
  "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
}
```

### Compress a PDF

Shrink a PDF's file size so it fits an email or an upload limit. The compressed PDF is saved so later steps can send, upload, or store it.

**Inputs**

- File (`file`, text, required): The PDF to compress: upload one, pick a file from an earlier step, or paste a public PDF URL.
- Compression level (`compression_level`, text): How hard to compress. Extreme makes the smallest file at some cost to image quality; low barely touches it. One of: `low`, `recommended`, `extreme`. Default: `recommended`.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_count": 1,
  "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "report_compressed.pdf",
      "size_bytes": 214366,
      "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "report_compressed.pdf",
  "size_bytes": 214366,
  "task_id": "g27d4mrsg3ztmnzagm5d",
  "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
}
```

### Convert a PDF to JPG

Turn each page of a PDF into a JPG image, or pull out the images already embedded in it. Every image is saved so later steps can post, attach, or store them.

**Inputs**

- File (`file`, text, required): The PDF to convert: upload one, pick a file from an earlier step, or paste a public PDF URL.
- What to convert (`pdfjpg_mode`, text): Whether to render whole pages as images, or extract only the pictures embedded in the PDF. One of: `pages` (Every page as an image), `extract` (Only the embedded images). Default: `pages`.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

```json
{
  "content_type": "image/jpeg",
  "document_count": 2,
  "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
  "documents": [
    {
      "content_type": "image/jpeg",
      "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "report-1.jpg",
      "size_bytes": 156204,
      "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    },
    {
      "content_type": "image/jpeg",
      "document_ref": "doc_2c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "report-2.jpg",
      "size_bytes": 148771,
      "url": "/actions/core/serve-document/doc_2c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "report-1.jpg",
  "size_bytes": 156204,
  "task_id": "g27d4mrsg3ztmnzagm5d",
  "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
}
```

### Convert Office file to PDF

Convert a Word, Excel or PowerPoint file to PDF. The PDF is saved so later steps can send, upload, or store it.

**Inputs**

- File (`file`, text, required): The Office file to convert (.docx, .xlsx, .pptx and the older and OpenDocument equivalents): upload one, pick a file from an earlier step, or paste a public URL. The name must keep its extension -- that is how iLovePDF knows what kind of file it is.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

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

### Make a scanned PDF searchable (OCR)

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

**Inputs**

- File (`file`, text, required): The scanned PDF to read: upload one, pick a file from an earlier step, or paste a public PDF URL.
- Languages (`ocr_languages`, list): The languages to look for, as three-letter codes -- eng, spa, fra, deu, ita, por, nld, rus, ara, jpn, kor, chi_sim, chi_tra and so on. Defaults to English.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_count": 1,
  "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "scan_ocr.pdf",
      "size_bytes": 1204663,
      "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "scan_ocr.pdf",
  "size_bytes": 1204663,
  "task_id": "g27d4mrsg3ztmnzagm5d",
  "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
}
```

### Merge PDFs

Join several PDFs into one file, in the order they are listed. The merged PDF is saved so later steps can send, upload, or store it.

**Inputs**

- PDFs (`files`, list, required): The PDFs to merge, in order (at least two). Upload them, reference documents from an earlier step, or give public PDF URLs.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

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

### Password-protect a PDF

Encrypt a PDF so it can only be opened with a password. The protected PDF is saved so later steps can send or store it.

**Inputs**

- File (`file`, text, required): The PDF to protect: upload one, pick a file from an earlier step, or paste a public PDF URL.
- Password (`password`, text, required): The password the PDF will need to be opened with. Anyone without it cannot read the file, so keep a copy somewhere safe.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_count": 1,
  "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "contract_protected.pdf",
      "size_bytes": 91744,
      "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "contract_protected.pdf",
  "size_bytes": 91744,
  "task_id": "g27d4mrsg3ztmnzagm5d",
  "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
}
```

### Remove a PDF's password

Take the password off a PDF you can already open, so later steps can read it without one. The unlocked PDF is saved for them to use.

**Inputs**

- File (`file`, text, required): The password-protected PDF: upload one, pick a file from an earlier step, or paste a public PDF URL.
- Current password (`password`, text, required): The password the PDF is protected with. iLovePDF needs it to open the file; it cannot remove a password that is not known.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_count": 1,
  "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "statement_unlocked.pdf",
      "size_bytes": 64310,
      "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "statement_unlocked.pdf",
  "size_bytes": 64310,
  "task_id": "g27d4mrsg3ztmnzagm5d",
  "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
}
```

### Split a PDF

Cut a PDF into separate files by page range, split it every N pages, or delete pages from it. Each resulting PDF is saved so later steps can use them.

**Inputs**

- File (`file`, text, required): The PDF to split: upload one, pick a file from an earlier step, or paste a public PDF URL.
- How to split (`split_mode`, text): What to do with the PDF's pages. Splitting every N pages needs nothing else filled in; the other two need the pages they act on. One of: `fixed_range` (Split every N pages), `ranges` (Split at page ranges), `remove_pages` (Remove pages). Default: `fixed_range`.
- Page ranges (`ranges`, text): Required when splitting at page ranges: which pages go into each output file. The first page is 1, so '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 holding just the pages listed above, instead of a separate PDF per range. Only applies when splitting at page ranges. Default: `false`.
- Pages per file (`fixed_range`, number): How many pages each output file gets, when splitting every N pages. 1 makes a PDF per page. From 1 to 10000. Default: `1`.
- Pages to remove (`remove_pages`, text): Required when removing pages: which pages to delete. The first page is 1, so '1,4,8-12' drops those pages and keeps the rest.
- Save as (`filename`, text): Optional. The name to save the result under. Defaults to the name iLovePDF gives it. When a step produces several files they are numbered, so 'page' saves as page-1.jpg, page-2.jpg and so on.

**Outputs**

- `content_type` (text): MIME type of the first saved file
- `document_count` (number): How many files this step saved
- `document_ref` (text): Reference to the first saved file, for use by a later step
- `documents` (list): The files this step saved, in the shape steps that send or upload files expect
- `filename` (text): Name the first file was saved under
- `size_bytes` (number): Size of the first saved file in bytes
- `task_id` (text): The iLovePDF task that did the work
- `url` (text): Download URL for the first saved file

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_count": 2,
  "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "report-1.pdf",
      "size_bytes": 88120,
      "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    },
    {
      "content_type": "application/pdf",
      "document_ref": "doc_2c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3",
      "filename": "report-2.pdf",
      "size_bytes": 74905,
      "url": "/actions/core/serve-document/doc_2c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "report-1.pdf",
  "size_bytes": 88120,
  "task_id": "g27d4mrsg3ztmnzagm5d",
  "url": "/actions/core/serve-document/doc_1c7a1e4b9d2f34a6c8b1e5f0d2a7c9e3?teamId=6512a1b2c3d4e5f600000001"
}
```
