Skip to main content
Document workflows4 min read

Extract Embedded Files and Attachments from a PDF

A PDF can carry whole other files inside it — spreadsheets, images, even other PDFs. Getting them out depends on whether you can see the attachments panel at all.

By BytesPDF Editorial TeamPublished
Nested file icons emerging from an open PDF document

People think of a PDF as pages. The spec also allows embedded file streams: whole attachments riding inside the container — CSVs, images, even other PDFs. Seeing them is viewer-dependent. Pulling them out is workflow-dependent.

Attachments vs portfolio vs pages

KindWhat it isHow you get it out
Embedded attachmentFile stream + /Filespec annotationAttachments panel / extractor CLI
Portfolio memberItem in a /Collection containerPortfolio UI or open member then save
Just a pageNormal contentPrint/export page — not "extraction"

Deep container mechanics live in portfolio vs merged PDF. This page is the pull files out path for attachments and portfolio members.

PDF container opening to reveal embedded file icons

Viewer matrix (why the panel "isn't there")

ViewerAttachments visible?Notes
Acrobat / Reader desktopYes — paperclip / AttachmentsReference behavior
Many Windows readersOftenFeature depth varies
macOS PreviewPoor / hiddenClassic false "no attachments"
Browser built-in previewsRarely / noDownload-first applies
CLI (pdfdetach -list)ExhaustiveTrust this over a blank panel

Empty panel ≠ empty file when the viewer is wrong. Confirm with a second viewer before you tell the sender "nothing was attached."

Routes to extract

  1. Acrobat/Reader: Attachments panel → select → save/extract to a folder.
  2. Full-featured desktop readers that implement embedded file

annotations — verify with a known test PDF.

  1. Command line: pdfdetach -list file.pdf then extract; pikepdf /

equivalent libraries for scripted batches. Power-user path, no GUI.

  1. Portfolios: open the collection UI, save each member; members may still

be native Office files that need their own tools.

After extraction, treat outputs as new files: scan them (pre-open habits), rename sanely (naming conventions), and do not assume the parent PDF's permissions govern the children.

Removal is the other direction

Extraction is for when you want the payload. When you are sending, the usual job is the inverse:

  • Strip attachments you did not mean to ship

(remove attachments before sending).

A PDF that looks like three pages can still carry a spreadsheet. That is why what to check before sending includes an attachments glance — with a viewer that actually shows them.

Honest BytesPDF scope

No attachment extraction tool at BytesPDF (documented boundary). Clean / sanitize paths cover removal of hidden payloads and metadata; extraction is readers and CLIs as above. We document the feature because hidden files are a privacy and QA issue for every outbound send — not because we pretend to edit portfolios.

TL;DR: paperclip in a full reader → save attachments out; blank Preview panel is a viewer lie; portfolios are a different container; when sending, strip instead of extract.

Frequently asked questions

How do I see files embedded inside a PDF?

In Acrobat/Reader: click the paperclip or open the Attachments panel (often under the side panel menu). Full desktop readers usually expose embedded file annotations; many browser previews and macOS Preview do not. If the panel is empty, the PDF may simply have no attachments — or your viewer is hiding them.

Why can't I find attachments in macOS Preview?

Preview does not present the full embedded-files annotation set that Acrobat's Attachments panel shows. Use Acrobat, another full reader, or a command-line extractor (pdfdetach, pikepdf) when you need a complete list of embedded payloads.

Portfolio PDF vs merged PDF — which one am I extracting from?

A portfolio is a container: one PDF file wrapping other files (often still in native formats) with a manifest UI. A merged PDF is a flat sequence of pages. Portfolios need extraction of the members; flat PDFs only have attachments if someone explicitly embedded them. See the portfolio vs merge guide for the split.

Can BytesPDF extract embedded attachments?

No — there is no attachment-extraction tool in the BytesPDF toolkit (documented boundary). Removal of hidden data and attachments is documented on the clean/sanitize side; extraction routes in this guide are external readers and CLIs.

Should I worry about embedded files before sending a PDF?

Yes — they travel with the file. Sanitize/remove attachments and metadata before external send ([remove attachments](/blog/how-to-remove-attachments-from-pdf), [remove hidden data](/blog/remove-hidden-data-from-pdf)), and treat unexpected embedded payloads as a reason to pause ([pre-open checks](/blog/check-pdf-for-virus-before-opening)).

Source-led comparisons written by BytesPDF, with the conflict of interest disclosed on each page. They link official provider documentation rather than fabricated tests.