How-to & Tips

How to Extract Embedded Files from a PDF

For the case where the file is inside the PDF but your reader shows no attachment to click, and for checking what is really in there first.

  • X(Twitter) icon
  • Facebook icon
  • LinkedIn icon
  • Copy link icon
how-to-extract-embedded-files-from-a-pdf-cover

An embedded file in a PDF is a file stored inside the PDF container, not drawn on a page. There are only two ways to get one out: a reader that lists the document's embedded files so you can save a copy, or a tool that reads that list directly from the file structure.

This guide is about the case those instructions skip — the file is in there, and the attachments panel gives you nothing to click. Three things cause that, and only one of them means the file is not there. If your reader does show a paperclip and a file list, the click-by-click version is How to Extract Embedded Files from PDFs; this page covers everything around it.

Why the File Is Inside but the Panel Is Empty

Check these in order. The first two are the usual answer.

You are reading it in a browser. A browser tab renders pages. It generally does not expose the embedded-file list at all, so there is no panel to open and no attachment to select. The file is still in the PDF you downloaded.

It is a Portfolio, not an ordinary document. A Portfolio is a container of files presented as a collection rather than as pages. Readers that handle it show a file collection instead of a normal attachment list, and a reader that does not handle it can look completely wrong.

It was stored as an associated file. Some PDFs are built to a PDF/A-3 profile — common in e-invoicing formats such as Factur-X and ZUGFeRD — where the machine-readable file is attached as an associated file rather than as a regular attachment. Not every attachments panel lists those, which is why a structural check is sometimes the only way to see what shipped with the document.

The file is encrypted. A password-protected PDF hides its embedded-file list along with everything else, so the panel stays empty until the document is unlocked. Extraction is not a way around a password.

Confirm What Is Actually in the File

Before hunting for a tool, settle whether there is anything to find. Two checks are enough.

Compare size with content. A four-page invoice at 40 MB is carrying something that is not on the page. A PDF whose size matches its pages probably has no attachments.

Ask the file directly. pdfdetach, from poppler-utils, prints the embedded-file list it finds in the structure itself. That means it sees files a panel would not show, and it works in a shell with no graphical interface. It is the single most useful check on this page.

pdfdetach -list report.pdf

One line per embedded file, or no output at all.

Method 1: Pull the Files Out with pdfdetach

pdfdetach runs on Windows, macOS and Linux. It is the practical route when there is no panel, when the PDF is a Portfolio, or when there are a dozen files and you would rather not click through them.

Step 1: List the Files

pdfdetach -list report.pdf

Note the names and the order. The order is what the numeric save uses.

Step 2: Save One File by Number or by Name

[[raw:<pre style="background:#f5f6f8;border-radius:6px;padding:12px;overflow:auto;"><code>pdfdetach -save 1 report.pdf pdfdetach -savefile "invoice.xml" report.pdf</code></pre>]]

Use the number when the names are unreadable, the name when the list is long.

Step 3: Save Everything into an Empty Folder

pdfdetach -saveall -o ./attachments report.pdf

An empty destination folder makes the count obvious, and it stops an attachment named invoice.pdf from overwriting something you already had.

Method 2: Save It from a Reader's Attachments Panel

If your reader does expose the list, this is fewer steps than any command line: open the PDF in the desktop application rather than the browser, open the Attachments panel, select the file, then save a copy to a folder you will remember. Side panels are often hidden until used, and some readers re-enable them from the View menu.

Two things go wrong here often enough to check before you blame the file. Some readers open documents in a protected mode where attachments stay read-only until you allow full features. And desktop readers keep a restricted list of file types — typically executables and scripts — that they will not open even after you have saved them.

What Extraction Does Not Do

Three limits, each a common reason someone repeats the whole process and gets the same result:

  • It does not remove the attachment. Extraction copies the file out. The PDF still carries it afterwards, and deleting it is a separate action.
  • It does not change the document. No pages are added or removed, the layout does not reflow, and nothing is converted — an extracted .xlsx is still an .xlsx.
  • It does not repair a damaged file. What was packed in is what comes out, including a zero-byte or truncated attachment.

Treat What You Extract as Untrusted

A file hidden inside a PDF is a well-worn malware route, precisely because the recipient never sees it in the page preview.

  • Save into a dedicated folder, then scan it. Do not launch the attachment from the reader's temporary location.
  • Be suspicious of executables and archives. If an unexpected PDF hands you a .zip, .exe or .js, ask the sender before opening anything.
  • Think before uploading. Online extractors upload the whole document, attachments included, to someone else's server. For a contract or a payslip, extract locally.

When the Embedded File Is Itself a PDF

A large share of embedded files are PDFs: exported statements, scanned contracts, drawings attached to a specification. Once saved they open like any other PDF, and a scanned one may need OCR before its text is editable.

For that second step, PDF Agile is a Windows desktop editor with a ribbon of File, Home, Insert, Edit, View and Page tools.

If it turns out the file you were chasing was never an attachment, the page-level tools live in Organize PDF. Extract Pages and Split pull pages into a new document, which is a different result from saving a file out of the container — and page images are page content, not embedded files. How to edit a PDF is the hub for everything that touches page content.

FAQ

Why does my PDF show no attachments at all?

Either it genuinely has none, or your viewer cannot list them. Browser viewers are the usual cause. Run the pdfdetach list command before concluding the file is empty.

Is an embedded file the same as an attachment?

Yes. The PDF specification calls them embedded files; readers label the same object an Attachments panel.

Can I extract from a password-protected PDF?

Not without the password. Encryption covers the embedded-file list too.

Can I use this to pull images out of a PDF?

No. Page images are page content, not embedded files, and extracting images from a PDF is a different job with a different output.

Sources: attachment behaviour from Adobe's documentation on PDF attachments; pdfdetach options from the poppler-utils manual; associated files from the PDF/A-3 and Factur-X/ZUGFeRD specifications. Steps reflect desktop tools as used in 2026; menus vary by reader and version. Adobe, Acrobat and Reader are trademarks of Adobe Inc.; macOS of Apple Inc.; Windows of Microsoft Corporation. Disclosure: we build PDF Agile. More walkthroughs are in How-to & Tips.

Related Articles

How-to & Tips9 Mins

How to Extract Embedded Files from PDFs Smoothly and Swiftly?

Explore the top 6 image recognition tools for AI image analysis and facial recognition in 2024. Enhance efficiency and security with ease.

Read More >>

How-to & Tips6 Mins

How to Attach a File to a PDF Without Merging Pages

Attach a Word, Excel, or PDF file to a PDF so it opens from a link, without merging or inserting a single page, then verify it before sending.

Read More >>

How-to & Tips3 Mins

How to Extract Pages from a PDF

This guide explains how to extract pages from PDFs using PDF Agile and Adobe Acrobat. It also covers the benefits of using PDF Agile and alternative methods for page extraction.

Read More >>