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

Extract Attachments from a PDF

embedded files out · ZIP them all · content sniffing · nothing uploaded

A PDF can carry whole files inside it, and most readers either bury the panel that lists them or refuse to save them out. Drop the PDF here and every embedded file comes back as a download — with a note on what each one actually is, which is not always what its name claims.

Drop PDFs here

Several at once is fine — each is listed separately

    no files
    Ready.

    What counts as an attachment

    An attachment is a complete file stored inside the PDF's structure, listed in its embedded-files name tree. It is not the same thing as an image drawn on a page — a photograph in a report is page content, and Extract images is the tool for those. Attachments are files a PDF is carrying rather than showing.

    Where they turn up in practice:

    Why the contents are checked

    Every attachment is examined for its magic number and the result is shown next to it. A file called invoice.xml whose first bytes are %PDF is worth knowing about before you hand it to a parser, and the extension inside a PDF is just a string somebody typed. Where the name and the bytes disagree, the listing says so.

    A PK header is flagged as a ZIP container rather than guessed at, because .xlsx, .docx, .odt and .epub are all ZIP files and the extension is the only thing separating them.

    When nothing comes out

    Most PDFs have no attachments at all, and an empty result usually means exactly that. The two other possibilities are worth ruling out: the file may be encrypted, in which case nothing inside it can be read until it is unlocked; or what you are after may be page content rather than an attachment, in which case Extract images or PDF to text is the tool you want.

    The other direction

    To put files into a PDF, use Attach files to PDF. The two tools round-trip: anything embedded there comes back out here byte for byte.

    Privacy

    100% client-side. The PDF is parsed and the attachments are unpacked in your browser. Nothing is uploaded — which matters here more than on most pages, because an embedded file is frequently the confidential part of the document. See the privacy policy.

    How to extract the files attached to a PDF

    1. Drop the PDF that carries embedded files — a ZUGFeRD/Factur-X e-invoice, a report with its source spreadsheet, a PDF portfolio.
    2. Click Extract attachments. Both the document-level embedded-files name tree and page-level file annotations are read.
    3. Review the list — every attachment with its filename, size and MIME type as recorded in the PDF.
    4. Download one file, or all of them as a ZIP. Nothing is uploaded; the downloads come out of your own tab's memory.

    FAQ

    How do I get the XML out of a ZUGFeRD or Factur-X invoice?

    Drop the invoice PDF and click Extract attachments. The XML (usually factur-x.xml, zugferd-invoice.xml or xrechnung.xml) is listed as an embedded file and downloads with one click — no accounting software needed to get at it.

    Why does an attachment's type not match its extension?

    Because the extension inside a PDF is just a string somebody typed, while the first bytes of the file are the truth. When the two disagree the listing says so, which saves a confusing parser error later.

    Can I get all the attachments in one go?

    Yes — the output offers every extracted file individually and all of them together as a single ZIP.

    The PDF definitely has attachments but nothing came out.

    Check whether the file is encrypted; an encrypted PDF hides its structure until it is unlocked. The other common cause is that what you are looking for is page content, not an attachment — a photo in a report is an image, so use Extract images instead.

    Are the extracted files uploaded anywhere?

    No. The PDF is parsed in your browser and the downloads come out of your own tab's memory. That matters more here than on most pages, because the embedded file is very often the confidential part of the document.