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

# Extract

> Comprehensive guide to PDF.co's extraction APIs for programmatically extracting data from PDF documents. Includes endpoints for document parsing, table extraction, and more.

export const CTAButton = ({href, text, download}) => {
  return <a href={href} download={download} target="_blank" rel="noopener noreferrer" className="text-[20px] font-medium p-5 bg-[#ff4848] text-white rounded-[5px] block w-fit mb-4">
      <span>{text}</span>
    </a>;
};

# [Document Parser](/api-reference/documentparser/overview)

## How Do I Transfer a Document Parser Template to Another PDF.co Account?

### Q: Can I transfer a template to another account?

Yes — by copying the raw template code and pasting it into the new account.

### Q: Where do I get the template code?

1. Open the [Document Parser Page](https://app.pdf.co/document-parser-tool/playground/choose-template)
2. Go to [Manage My Templates](https://app.pdf.co/document-parser-tool/manager)
3. Click the **three dots** next to your template name
4. Select **View Raw Code**
5. Copy the full code shown

### Q: How do I add it to the other account?

1. Log in to the second PDF.co account
2. Go to the [Template Editor](https://app.pdf.co/document-parser/templates/new)
3. Click **Edit Raw Template**
4. Paste the code
5. Click **Save Template and Return**

### Q: Anything else I should know?

* Template names can be changed after pasting
* No automatic sync — this is a manual copy

## Parse Only Specific Pages in a PDF by Keyword (e.g., “Driver Copy”)

You can extract and parse specific pages from a PDF by searching for a keyword (like “Driver Copy”) and processing only those pages

### Follow these 3 steps:

1. Find the pages containing the keyword

* Use the [/pdf/find](/api-reference/pdf-find) API.
* Set `searchString` to a keyword or regex

**Example:**

```json theme={null}
"searchString": "(?s)Driver.*?Disc."
```

This returns the page numbers where the keyword is found.

2. Split the PDF to extract those pages

* Use the [/pdf/split](/api-reference/pdf-split) API.
* Set the `pages` parameter to the page numbers returned in step 1.
* This creates new PDFs with only the target pages.

3. Parse the split pages

* Use the [/pdf/documentparser](/api-reference/documentparser/overview) API.
* Pass the split PDF
* Use your custom Document Parser template to extract data.

### Helpful Tips

* Use this method if you don’t know the page numbers in advance.
* If you already know the page numbers, skip step 1 and go straight to [/pdf/split](/api-reference/pdf-split).
* For large files, use `"async": true` and monitor job status.
* Ensure your Document Parser template is aligned to the content of the Driver copy section.

### Related Guides:

* [Zapier: How to Split and Parse PDFs in Zapier](https://pdf.co/tutorials/how-to-split-a-multi-page-pdf-invoice-and-extract-data-using-zapier)
* [Make/Integromat: How to Split and Parse Multi-paged PDFs in Make](https://pdf.co/tutorials/how-to-split-a-multi-page-pdf-invoice-and-extract-data-using-make)

## Parse Every Page in a Multi-Page PDF

You want to extract structured data from all pages of a multi-page PDF using the Document Parser.
The [/pdf/documentparser](/api-reference/documentparser/overview) API processes only one page at a time for non-table fields.

To parse all pages, follow this 2-step workflow:

### Step 1: Split the PDF into separate pages

* Use the [/pdf/split](/api-reference/pdf-split) or [/pdf/split2](/api-reference/pdf-split/by-text-search-or-barcode) API.
* Set the `pages` parameter to `"*"` to split the PDF into individual files—one file per page.

**Example:**

```json theme={null}
{ "pages": "*" }
```

This will return a separate PDF for each page.

### Step 2: Parse each page separately

* Run the [/pdf/documentparser](/api-reference/documentparser/overview) API for each split PDF file.
* Use the same Document Parser template if the layout is the same across pages.
* Automate this step using your integration platform (Zapier, Make, or API).

**Example:** Parse all pages in a 5-page PDF

* Split step: Returns 5 PDFs (page1.pdf, page2.pdf, page3.pdf, page4.pdf, page5.pdf).
* Parse step: Run [/pdf/documentparser](/api-reference/documentparser/overview) once for each file.

### Related Guides:

* [Zapier: Split PDF and Run Document Parser](https://pdf.co/tutorials/how-to-split-a-multi-page-pdf-invoice-and-extract-data-using-zapier)
* [Make/Integromat: Split & Parse PDFUsing Document Parser](https://pdf.co/tutorials/how-to-split-a-multi-page-pdf-invoice-and-extract-data-using-make)

### Helpful Tips

* Use `"pages": "*"` to split each page individually.
* For large documents, enable `"async": true` and check the job status.
* Ensure the parsing template works consistently across all pages.

# Document Classifier

## How to Parse a Document Based on Its Document Type

You want to classify a document first (e.g., bank statement, receipt) and automatically apply the correct parsing template—without manually choosing the template.

### Why This Happens

The Document Classifier identifies the document type but doesn’t automatically tell the Document Parser which template to use.

You need to connect the classifier output to the parser input.

### How to Link the Classifier to a Parser Template

Use the **template ID as the class name** in your Document Classifier.

1. Create your [Document Parser template](https://app.pdf.co/document-parser-tool) → copy the **template ID** (e.g., `12345`).
2. In the [Document Classifier](https://app.pdf.co/document-classifier) → set the **class name to match the template ID**.
3. Run the classifier → it returns the class name (which is the template ID).
4. Pass the class name to `/pdf/documentparser` as the `templateId` parameter.

**Result:** The correct template is automatically applied based on the document type.

**Example**

* Your invoice template ID = `98765`
* Set class name = `98765` in the classifier
* Classifier output: `{"className": "98765"}`
* Pass `98765` to `/pdf/documentparser` → parses with the invoice template

### Platform-Specific Related Resources

* [Zapier: Classify and Parse Documents](https://pdf.co/tutorials/how-to-classify-documents-using-pdf-co-and-zapier)
* [Video Tutorial: How It Works](https://www.youtube.com/watch?v=E2iAzmaph7Y\&t=107s)

### Helpful Tips

* Class name must **exactly match** the template ID.
* If you're using code, you can extract the class name from the classifier JSON output.
* Use the [/pdf/documentparser](/api-reference/documentparser/overview) endpoint to run the parser using the ID.
