Skip to main content

Extract Attachment from PDF

ExtractExtract Attachment from PDF

The Extract Attachment from PDF API retrieves all file attachments embedded in a PDF. You send the PDF as Base64 (docContent), docName, and optionally async. The API returns JSON with attachment data or a ZIP containing all extracted files. Use the tester below to try it; more details are in the sections that follow.

Try the Extract Attachment from PDF API

Quick reference

Endpoint: POST /api/v2/ExtractAttachmentFromPdf · Required: api-key, docContent, docName

Try it live

Use the form below to send your API key and PDF (Base64). The response is JSON or a ZIP with all embedded attachments. No code required—fill the fields and click Send request.

Loading API Tester...

Overview, parameters, and use cases

What is Extract Attachment from PDF?

This endpoint extracts all file attachments embedded in a PDF. You provide the PDF (Base64) and optionally enable async; the API returns either JSON with attachment metadata and content or a ZIP file containing all extracted files. Use it to retrieve files that were embedded with Add Attachment to PDF.

Key features

  • All attachments – Extracts every file embedded in the PDF (any type: text, images, documents, archives).
  • JSON or ZIP – Response can be JSON with attachment data or a ZIP with all extracted files.
  • Async – Use async for PDFs with many or large attachments.
Best for

Use when you need to retrieve supporting files from a PDF (e.g. source data, images, spreadsheets). Pair with Add Attachment to PDF for round-trip: add attachments, then extract them.

Prerequisites

Before using this endpoint, make sure you have:

  • A valid PDF4me API key (Get your API Key)
  • A PDF document in Base64 format or a public URL to a PDF file
  • The PDF document should contain embedded attachments

Response Format

The API returns a JSON response with extracted attachment data or a ZIP file containing all extracted attachments.

Get Help