A PDF can carry files inside it that never appear on any page: spreadsheets, source documents, or extra attachments. Listing those embedded files before you share the PDF tells you exactly what else you are sending.
What you need
- qpdf installed
- A PDF to check before sharing
- A terminal
Step 1: List the embedded files
Run qpdf –list-attachments file.pdf and read the list of attachment names, sizes, and descriptions. An empty list means the PDF carries no embedded files.
Step 2: Open each attachment and judge it
Run qpdf –show-attachment=name file.pdf to save each attachment to disk, then open it and check whether it belongs in the shared copy or should be removed.
Step 3: Decide before you send
If an attachment is private or unnecessary, remove it with your PDF editor and re-run the list command to confirm the PDF is clean before sharing.
Worked example: synthetic attachment check on a shared report
The table below is a synthetic example. It shows the expected result of listing attachments; no listing was run.
| Attachment | Size | Decision |
|---|---|---|
| budget-2026.xlsx | 48 KB | Remove, contains private figures |
| source-notes.txt | 3 KB | Remove, internal notes |
| cover-letter.pdf | 120 KB | Keep, part of the package |
| Total | 171 KB | 2 of 3 attachments removed |
Expected result (UNTESTED). the listing shows three embedded files, two of which are private and must be removed before sharing, while the cover letter stays. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- qpdf lists attachments stored in the PDF; it does not find files linked from the PDF by URL.
- Removing an attachment changes the file, so keep the original until the cleaned copy is verified.
- Some PDFs store attachments in a portfolio structure that needs a portfolio-aware reader to open.
