pdftoolskit.org
PDF (Portable Document Format) utilities, in the browser
Say hi →

Sample PDF with File Attachments Inside

2 pages · 2 embedded files (CSV + TXT) · CC0

A PDF can carry other files inside it — a feature most people discover only when an invoice arrives with its machine-readable XML tucked into the PDF. This sample embeds two attachments: embedded-data.csv (a tiny three-row table) and readme-attachment.txt (one paragraph of plain text), both registered properly in the document's EmbeddedFiles name tree.

What's embedded, exactly

What to test with it

Where attached files show up in the real world

Electronic invoicing is the big one: standards like ZUGFeRD and Factur-X are exactly this — a human-readable PDF with the machine-readable XML invoice embedded inside it. Court filings, lab reports with raw data, and email-to-PDF archivers use the same mechanism. If your pipeline touches invoices from EU suppliers, this file is a miniature of what will arrive.

FAQ

Is this the same as a "PDF portfolio"?

Close but no. A portfolio (PDF package) is a container whose main content is the collection of files, with a special navigation UI. This sample is a normal document that happens to carry attachments — the far more common case, and the one libraries support consistently.

Do attachments survive merge / split / compress?

Document-level attachments are the most commonly dropped data in PDF processing — many tools rebuild the document and never copy the EmbeddedFiles tree. That's precisely what this file lets you find out about your toolchain before production does.

Can attachments be malicious?

An attachment is just stored bytes — it can be anything, which is why mail gateways often strip or flag PDFs with embedded executables. These two are inert text files with fully documented contents.

How do I add attachments to my own PDF?

Use the attach files tool — runs entirely in your browser. Programmatically, it's doc.attach() in pdf-lib (remember to await it — it's async, and yes, that's a lesson from this file's own build script).