# Embed PDF (PDF/A-3)

Drop your PDF and the invoice XML, in any order. When both are in, the page builds one file on its own: your PDF, with factur-x.xml inside it.

Source: https://tally-stick.com/attach-xml-to-pdf

## How it works

The PDF/A-3 label is a promise the file keeps. A PDF whose own metadata already says PDF/A leaves untouched: the invoice is appended the way PDF updates work, pages byte for byte. A plain PDF is read and rebuilt first: every page repainted exactly as it looks, the text carried over as a real, selectable layer, the whole file written as PDF/A-3B, and only then does the invoice ride in. The page names which of the two your file took.

The XML side is the UN/CEFACT CII syntax at the EN 16931 profile, the same attachment [Excel to ZUGFeRD](https://tally-stick.com/excel-to-zugferd) and [Create XRechnung](https://tally-stick.com/create-xrechnung) write. If you have neither yet, write the XML first: this tool does not translate between invoice syntaxes.

Nothing is uploaded. The hybrid is assembled in your own browser, under the site's fair usage limit. A PDF that is encrypted, already carries an attachment, or cannot be read is refused with the reason named, never half-processed.

## What is checked before anything is written

Both files are checked before anything is written. The PDF must be a readable, unencrypted PDF that carries no embedded file yet, and the XML must be a CII invoice. A plain PDF is rebuilt to PDF/A-3 first, so the file holds what the label promises. A refusal names its reason and your original file is left untouched.

## Common questions

### Will my PDF look different?

No. On the direct path your pages are carried over byte for byte. On the rebuild path every page keeps its look too: it is repainted exactly as it appears, and the text rides along as a selectable layer. The rebuilt file is written as PDF/A-3B, which is what lets the label say PDF/A-3.

### Which PDF should I use?

Any invoice PDF: one exported as PDF/A attaches directly, and a plain one is rebuilt to PDF/A-3 first. An encrypted PDF, or one that already carries an embedded file, is refused rather than half-processed.

### Where does the XML come from?

Write it with [Excel to ZUGFeRD](https://tally-stick.com/excel-to-zugferd), or type the invoice on [Create XRechnung](https://tally-stick.com/create-xrechnung). The attachment is UN/CEFACT CII, which is what ZUGFeRD 2.x and Factur-X carry; UBL or FatturaPA files are not converted.

### Is this the same file Excel to ZUGFeRD writes?

That tool builds the whole PDF, letterhead to totals, as a PDF/A-3B file. This one keeps your own layout and adds the invoice to it. When you do not need your own PDF's look, the Excel route is the simpler one.

## Related tools

- [Excel to ZUGFeRD](https://tally-stick.com/excel-to-zugferd)
- [Create XRechnung](https://tally-stick.com/create-xrechnung)
- [ZUGFeRD to Excel](https://tally-stick.com/zugferd-to-excel)
- [Factur-X to Excel](https://tally-stick.com/factur-x-to-excel)
