Seán Healy

Technical Founder

Based in Dublin, Ireland

Contact: sean@seanhealy.ie


← Back to Portfolio

Mirrors:

Languages used
git clone https://codeberg.org/seanhly/recover-pdfs

recover-pdfs recovers all PDFs from any kind of disk or filesystem.

Logo
  • Did you accidentally delete one or all of your PDF documents?
  • Do you need an important PDF bank statement from an old computer, but the 2008 hard-drive won’t boot?

I built recover-pdf as a filesystem-agnostic tool for recovering PDF documents. It literally looks over every bit of information on your disk and anything that looks like a PDF gets put into a recovery directory.

Usage: recover-pdfs <DISK_OR_IMAGE_FILE> <BACKUP_DIRECTORY>

DISK_OR_IMAGE_FILE can be replaced with the actual disk device in /dev, e.g. /dev/sda1. Alternatively, DISK_OR_IMAGE_FILE can be an ISO or any similar image file. Basically it can be anything made up of 1s and 0s and readable by C file APIs.

BACKUP_DIRECTORY iss the directory/folder where you’d like the backed up PDFs to go. The program does not do de-duplication. This can be done with other tools, such as duff *.

Build, install, and run

# Compile the program
make
# Optionally, install it to /usr/bin
# sudo cp recover-pdfs /usr/bin
# Set up a backup directory
mkdir -p recovered_pdfs
# Run the program
./recover-pdfs old_laptop.img recovered_pdfs

Alternative workflow with pipe viewer

If you’d like a progress bar, you can use pipe viewer to see how much of the disk/image file has been processed.

# Install pipe viewer if you don't have it already
sudo apt install pv
# Run the program with pipe viewer to see progress
pv old_laptop.img | ./recover-pdfs - recovered_pdfs