LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pdfdetach

lists or extracts embedded files from a PDF file

TLDR

List all attachments in PDF
$ pdfdetach -list input.pdf
copy
Save attachment by number
$ pdfdetach -save 1 input.pdf
copy
Save attachment by name
$ pdfdetach -savefile filename input.pdf
copy
Save all attachments
$ pdfdetach -saveall input.pdf
copy
Save with custom output name
$ pdfdetach -save 1 -o output.txt input.pdf
copy
Extract from password-protected PDF
$ pdfdetach -save 1 -upw password input.pdf
copy
List with specific encoding
$ pdfdetach -list -enc UTF-8 input.pdf
copy

SYNOPSIS

pdfdetach [options] PDF-file

DESCRIPTION

pdfdetach lists or extracts embedded files (attachments) from a PDF file. It is part of the poppler-utils package.

PARAMETERS

-list

List all embedded files in the PDF
-save NUMBER
Save embedded file by its index number
-savefile FILENAME
Save embedded file by its filename
-saveall
Save all embedded files using their original names
-o PATH
Set output file name or directory for saved files
-enc ENCODING
Specify text encoding for filenames (default: UTF-8)
-opw PASSWORD
Owner password for encrypted PDF
-upw PASSWORD
User password for encrypted PDF
-v
Display version information
-h, --help
Display usage information

INSTALL

sudo apt install poppler-utils
copy
sudo dnf install poppler-utils
copy
sudo apk add poppler-utils
copy
nix profile install nixpkgs#poppler-utils
copy

CAVEATS

Exit codes: 0 (success), 1 (PDF opening error), 2 (output file error), 3 (permissions issue), 99 (other errors). Attachment numbers start at 1.

HISTORY

pdfdetach is part of poppler-utils, a set of command-line utilities based on the Poppler PDF rendering library.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid