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

# Convert PDF to E-Invoice

> Create a Factur-X or ZUGFeRD e-invoice in Zapier by embedding invoice XML in a PDF and validating the result.

Use the **Convert PDF to E-Invoice** action to embed invoice XML into a PDF/A-3 document. The action validates the result with veraPDF and Mustang.

Provide a PDF invoice and matching Factur-X or ZUGFeRD XML. This action does not generate invoice XML or compare the amounts in the XML with the visible PDF.

![Zapier Convert PDF to E-Invoice action with the PDF mapped from a Google Drive trigger and the XML mapped from a Find a File step](https://mintcdn.com/pdfco/GdtF0b3J8SH7nlPG/images/integrations/zapier/pdf-to-e-invoice-setup.png?fit=max\&auto=format\&n=GdtF0b3J8SH7nlPG\&q=85\&s=7bd486c73af476412c25901b285ed666)

The screenshot maps **Source PDF URL** from the Google Drive trigger and **Invoice XML URL** from the **Find a File** step, with **ZUGFeRD** selected as the profile.

## Input

| Name | Description | Required |
| - | - | - |
| **Source PDF URL** | Provide the URL of the source PDF invoice. The file must be accessible to PDF.co. See [Integrating File Sources with PDF.co](https://developer.pdf.co/integrations/zapier/input-file-sources.md) for help mapping file links. | Yes |
| **Invoice XML URL** | Provide a public or temporary presigned URL to the CrossIndustryInvoice XML that matches the PDF invoice. XML is limited to **5 MiB**. | Yes |
| **Profile** | Select **Factur-X** or **ZUGFeRD**. The default is **Factur-X**. The detailed conformance level is read from the XML. | Yes |
| **File Name (optional)** | Enter a name for the output PDF. If left empty, the original file name is used. | No |
| **HTTP Username (optional)** | Username for HTTP authentication when required by the source PDF URL. It does not apply to the XML URL. | No |
| **HTTP Password (optional)** | Password for HTTP authentication when required by the source PDF URL. It does not apply to the XML URL or unlock a password-protected PDF. | No |

The supported conformance levels are `MINIMUM`, `BASIC WL`, `BASIC`, `EN16931`, and `EXTENDED`. Select the profile family that matches your invoice XML.

### Getting both file URLs

The two URLs do not have to come from the same trigger. You can map **Source PDF URL** from one earlier step and **Invoice XML URL** from another.

For example, if a new-file trigger provides only the PDF, add a search step before PDF.co to find the matching invoice record in your accounting system or a lookup table. Use a shared invoice ID, such as `INV-1001`, to retrieve that invoice's XML URL. Map the PDF from the trigger and the XML URL from the search result into the PDF.co action.

> [!WARNING]
>
> Both files must be ready before the PDF.co step runs. If the matching XML is missing or the lookup is ambiguous, stop the workflow and resolve the match first. Each invoice needs its own matching XML; do not reuse the sample XML for other invoices.

The XML must already exist as a supported invoice XML document, and its URL must let PDF.co download the file. A link that opens a sign-in page or file-sharing preview is not a direct XML download. See [Zapier field mapping](https://help.zapier.com/hc/en-us/articles/8496343026701-Send-data-between-steps-by-mapping-fields) and [search steps](https://help.zapier.com/hc/en-us/articles/8496241402253-Search-for-existing-data-in-Zap-workflows) for setup details.

## Example: Create a Factur-X invoice

1. Add a **PDF.co** action after the steps that provide your PDF and invoice XML.

2. Select **Convert PDF to E-Invoice** and connect your PDF.co account. See [Getting Started with Zapier](https://developer.pdf.co/integrations/zapier/getting-started.md) for connection instructions.

3. Map your PDF and XML links to the corresponding input fields. To try the action, use this matching sample pair:

   | Field | Sample value |
   | - | - |
   | **Source PDF URL** | `https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-e-invoice/sample.pdf` |
   | **Invoice XML URL** | `https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-e-invoice/sample-document-services-invoice.xml` |
   | **Profile** | **Factur-X** |
   | **File Name (optional)** | `invoice-facturx.pdf` |

4. Test the action and review the validation result.

5. Map `url` to your storage app's upload step to save the validated invoice. You can also save the JSON report from `validationReportUrl`.

> [!NOTE]
>
> This action is available in PDF.co app version **4.1.0** and later. If it is missing from an existing Zap, select the current PDF.co app version for that step.

## Output

| Name | Description |
| - | - |
| `url` | Temporary link to the validated PDF containing the invoice XML. |
| `pageCount` | Number of pages in the output PDF. |
| `status` | Job result. A validated e-invoice returns `success`. |
| `message` | Message describing the job result. |
| `isCompliant` | `true` when the document passes all required validation checks. A non-compliant e-invoice fails the step. |
| `validationStatus` | Whether validation completed. |
| `pdfaProfile` | PDF/A profile used for validation, such as `PDF/A-3B`. This is separate from the **Profile** input, which selects the invoice family. |
| `validationReportUrl` | Temporary link to the JSON validation report, when available. |
| `validationReportName` | Name of the validation report file. |
| `failedRules` | Number of validation rules that failed. |
| `failedChecks` | Number of individual validation checks that failed. |
| `validator` | Validators used, such as `veraPDF+Mustang`. |
| `validatorVersion` | Versions of the validators used for this job. |
| `jobId` | Identifier for the PDF.co background job. |
| `credits` | Credits reported for processing the document. |
| `remainingCredits` | Remaining PDF.co credit balance. |

## Timeouts and validation

> [!WARNING]
>
> In the Zapier editor, **Test step** has a [30-second execution limit](https://docs.zapier.com/integrations/build/troubleshoot-action-timeouts#testing-action-in-zap-editor). An editor timeout does not cancel the PDF.co job, which can continue processing and incur charges. Check [PDF.co API Logs](https://app.pdf.co/account/logs/api) before submitting it again.

Published Zaps receive the result through a callback and resume when processing finishes. A job that times out in the editor may still complete in a published Zap.

If the e-invoice fails validation, the step fails and the conversion charge is refunded. The error includes a **Validation report:** link when a report is available. Open that report to review the failed checks, correct the input PDF or XML, and submit the corrected files.

Save the validated invoice and report to your own storage before their temporary links expire. See the [PDF to E-Invoice API reference](https://developer.pdf.co/api/pdf-to-e-invoice.md) for XML requirements, validation details, and file-retention limits.

To archive a PDF without embedding invoice XML, use [Convert PDF to PDF/A](https://developer.pdf.co/integrations/zapier/pdf-to-pdfa.md).


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