> ## Documentation Index
> Fetch the complete documentation index at: https://docs.condotta.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# PDF Tools

> Create PDFs from structured content, and extract text, get metadata, merge, split and rotate PDF documents.

The PDF Tools connector creates PDFs from structured content and works with existing ones: extracting text, merging, splitting, and manipulating pages.

> [!NOTE]
>
> No connection required; this utility connector works out of the box.

All PDF inputs and outputs are **base64-encoded** strings.

## Tools

> [accordion] create-pdf: Create a PDF report
>
> Builds a PDF from text you write in simple Markdown, rows from an earlier step, or both, laid out top to bottom. The content comes first, then the rows as a table, then any `blocks`. Text wraps, tables continue onto new pages with their header repeated, and every page can carry a footer and a page number. Text uses Noto Sans, which covers Latin, Greek, Cyrillic and Vietnamese; Chinese, Japanese and Korean characters are not supported yet and print as `?` (they are listed in `unsupportedCharacters`).
>
> **content** `string`
>
> The document text in simple Markdown. Insert `{{ variables }}` from earlier steps anywhere in it.
>
> * `# Heading`, `## Heading`, `### Heading` (deeper levels print as `###`)
> * Plain lines become paragraphs; a blank line starts a new one
> * `**Label:** value` lines become a label and value list, for invoice or order headers
> * `- item` lines become a bulleted list, and `1. item` lines a numbered one
> * A `| a | b |` table with a `|---|---|` line under the header; `---:` right-aligns a column
>
> Bold, italic and code markers are removed (the PDF uses one text style), links print as "text (url)", and images in Markdown are not loaded.
>
> **rows** `object[] | array[]`
>
> Rows from an earlier step, such as `{{ my_query.rows }}` or `{{ csv_tools_1.items }}`, drawn as a table after the content. For a list of objects, the keys become the column headers (`on_hand` prints as "On hand"); number columns are right-aligned. A list of lists, a JSON string of rows, or an output that wraps its rows in `rows`, `data`, `items`, `results` or `records` also works.
>
> **columns** `string[]`
>
> Which fields of `rows` to show, in order (default: every field). For a list of lists, the column headers.
>
> **blocks** `object[]`
>
> Advanced: exact layout blocks, added after the content and rows. Use these for images or page breaks. Each block has a `type`:
>
> * `heading`: `text`, optional `level` 1 to 3
> * `paragraph`: `text` (blank lines start new paragraphs)
> * `keyValue`: `items`, a list of `{ "label", "value" }`, for invoice or order headers
> * `list`: `items`, a list of strings shown as bullet points, or numbered with `"ordered": true`
> * `table`: `columns` (each `{ "header", "width"?, "align"? }`, `width` is a relative weight, `align` is `left` or `right`) and `rows` (one array of cells per row)
> * `image`: `data` (base64 PNG or JPEG), optional `width` in points and `align`
> * `spacer`: optional `height` in points
> * `pageBreak`
>
> **title** `string`
>
> Title printed at the top and set as the PDF title.
>
> **pageSize** `string`
>
> `A4` (default) or `Letter`.
>
> **orientation** `string`
>
> `portrait` (default) or `landscape`.
>
> **margin** `number`
>
> Page margin in points, 18 to 144 (default 48).
>
> **footer** `string`
>
> Text printed at the bottom of every page.
>
> **pageNumbers** `boolean`
>
> Print "Page N of M" on every page (default true).
>
> **author** `string`
>
> PDF author metadata.
>
> At least one of `content`, `rows` or `blocks` is required. Images must be passed as base64 data; the tool never fetches anything from a URL. A document is limited to 500 pages, 20,000 rows and 20 columns per table, 5 MB per image and 20 MB of input. Fonts are embedded in full, so a PDF is around 500 KB at minimum.
>
> **Example content (Markdown):** an order confirmation typed into the **Content** box, using values from an earlier `shopify_1` step.
>
> ```markdown theme={null}
> # Order confirmation
>
> **Order:** {{ shopify_1.order.name }}
> **Customer:** {{ shopify_1.order.customer.name }}
> **Ship to:** {{ shopify_1.order.shipping_address.city }}
>
> Thanks for your order. Everything below is packed and leaves our warehouse within two business days.
>
> ## Items
>
> | Product | SKU | Qty | Price |
> |---|---|---:|---:|
> | Merino crew jumper | MJ-104 | 2 | $178.00 |
> | Wool socks, 3 pack | WS-220 | 1 | $29.00 |
>
> **Total:** $207.00
>
> ## Next steps
>
> 1. You will get a tracking link by email when the parcel ships.
> 2. Reply to this email to change the delivery address.
>
> - Returns are free within 30 days
> - Questions? Contact support@example.com
> ```
>
> This prints a heading, a label and value list for the order details, a paragraph, a table with the quantity and price columns right-aligned, a numbered list and a bulleted list. To print the line items from a step instead of typing the table, leave the table out and set `rows` to `{{ shopify_1.order.line_items }}`, with `columns` listing the fields to show. A `rows` table always prints after all of the content, so put anything that would follow it, such as the total, in the content above it instead.
>
> **Example request** (content and rows together):
>
> ```json theme={null}
> {
>   "title": "Weekly sales report",
>   "footer": "Acme Pty Ltd",
>   "content": "**Week ending:** 12 October 2026\n\n## Orders by region",
>   "rows": [
>     { "region": "New South Wales", "orders": 412 },
>     { "region": "Victoria", "orders": 388 }
>   ]
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "success": true,
>   "pdf": "JVBERi0xLjcKJYGBgYEKCjUgMCBvYmoK...",
>   "pageCount": 1,
>   "sizeBytes": 489310,
>   "unsupportedCharacters": []
> }
> ```

> [accordion] extract-text: Extract text from PDF
>
> **pdf** `string` *required*
>
> Base64-encoded PDF.
>
> **maxPages** `number`
>
> Maximum number of pages to extract.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "pdf": "JVBERi0xLjQKMSAwIG9iago8PAovVH...",
>   "maxPages": 2
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "text": "Invoice #1042\nDate: 2025-03-15\n\nBill To:\nAcme Corp\n123 Main St\n\nItem          Qty   Price\nWidget A        3   $29.99\nGadget B        1   $59.99\n\nTotal: $149.96",
>   "numPages": 2,
>   "info": {
>     "Title": "Invoice 1042",
>     "Author": "Billing System",
>     "Creator": "ReportGen 3.0"
>   }
> }
> ```

> [accordion] get-info: Get PDF metadata
>
> Returns page count, title, author, and other metadata.
>
> **pdf** `string` *required*
>
> Base64-encoded PDF.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "pdf": "JVBERi0xLjQKMSAwIG9iago8PAovVH..."
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "pageCount": 3,
>   "title": "Quarterly Report Q1 2025",
>   "author": "Finance Team",
>   "subject": "Q1 Financial Summary",
>   "creator": "Google Docs",
>   "producer": "Skia/PDF m133",
>   "creationDate": "2025-03-20T14:30:00.000Z",
>   "modificationDate": "2025-03-21T09:15:00.000Z",
>   "keywords": null,
>   "pages": [
>     { "pageNumber": 1, "width": 612, "height": 792, "rotation": 0 },
>     { "pageNumber": 2, "width": 612, "height": 792, "rotation": 0 },
>     { "pageNumber": 3, "width": 612, "height": 792, "rotation": 0 }
>   ]
> }
> ```

> [accordion] merge: Merge multiple PDFs
>
> Combine multiple PDFs into a single document.
>
> **pdfs** `string[]` *required*
>
> Array of base64-encoded PDFs.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "pdfs": [
>     "JVBERi0xLjQKMSAwIG9iago8PAovVH...",
>     "JVBERi0xLjUKJeLjz9MKMSAwIG9iago..."
>   ]
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "success": true,
>   "pageCount": 5,
>   "pdf": "JVBERi0xLjcKMSAwIG9iaiA8PAovVH..."
> }
> ```

> [accordion] extract-pages: Extract specific pages
>
> Create a new PDF with only the specified pages.
>
> **pdf** `string` *required*
>
> Base64-encoded PDF.
>
> **pages** `number[]` *required*
>
> Page numbers to extract (1-indexed).
>
> **Example request:**
>
> ```json theme={null}
> {
>   "pdf": "JVBERi0xLjQKMSAwIG9iago8PAovVH...",
>   "pages": [1, 3, 5]
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "success": true,
>   "pageCount": 3,
>   "extractedPages": [1, 3, 5],
>   "pdf": "JVBERi0xLjcKMSAwIG9iaiA8PAovVH..."
> }
> ```

> [accordion] split: Split into single-page PDFs
>
> Split a PDF into individual single-page PDFs.
>
> **pdf** `string` *required*
>
> Base64-encoded PDF.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "pdf": "JVBERi0xLjQKMSAwIG9iago8PAovVH..."
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "success": true,
>   "totalPages": 3,
>   "pages": [
>     { "pageNumber": 1, "pdf": "JVBERi0xLjcKMSAwIG9iaiA8PA..." },
>     { "pageNumber": 2, "pdf": "JVBERi0xLjcKMiAwIG9iaiA8PA..." },
>     { "pageNumber": 3, "pdf": "JVBERi0xLjcKMyAwIG9iaiA8PA..." }
>   ]
> }
> ```

> [accordion] rotate: Rotate pages
>
> **pdf** `string` *required*
>
> Base64-encoded PDF.
>
> **degrees** `string` *required*
>
> Rotation angle (clockwise): `"90"`, `"180"`, or `"270"`.
>
> **pages** `number[]`
>
> Pages to rotate (all pages if omitted).
>
> **Example request:**
>
> ```json theme={null}
> {
>   "pdf": "JVBERi0xLjQKMSAwIG9iago8PAovVH...",
>   "degrees": "90",
>   "pages": [2, 4]
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "success": true,
>   "rotatedPages": [2, 4],
>   "pdf": "JVBERi0xLjcKMSAwIG9iaiA8PAovVH..."
> }
> ```

> [accordion] remove-pages: Remove specific pages
>
> Create a new PDF with the specified pages removed.
>
> **pdf** `string` *required*
>
> Base64-encoded PDF.
>
> **pages** `number[]` *required*
>
> Page numbers to remove (1-indexed).
>
> **Example request:**
>
> ```json theme={null}
> {
>   "pdf": "JVBERi0xLjQKMSAwIG9iago8PAovVH...",
>   "pages": [2, 4]
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "success": true,
>   "originalPageCount": 5,
>   "newPageCount": 3,
>   "removedPages": [2, 4],
>   "pdf": "JVBERi0xLjcKMSAwIG9iaiA8PAovVH..."
> }
> ```

> [card] [Try this free for 14 days](https://preview.condotta.ai/signup)
>
> Start a 14-day trial on Band 1. At day 14, choose your band, or stop.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.