If you don't manage to find a better solution you could give this script a try:
#!/bin/bash
# NAME: pdfwalker
# AUTHOR: (c) 2014 Glutanimate <https://github.com/Glutanimate/>
# DESCRIPTION: Invoke one pdf file at a time
# DEPENDENCIES: mupdf
# LICENSE: GNU GPLv3 (http://www.gnu.de/documents/gpl-3.0.en.html)
############# Functions ###############
gui_notify(){
notify-send -i application-pdf "PDF Walker" "$1"
echo "$1"
}
arg_compose_filearray(){
# recursively add pdf files and folders in given arguments to array
unset Files
FileCountCurrent="1"
while IFS= read -r -d $'\0' File; do
if [[ ! "$(file -ib "$File")" == *application/pdf* ]]
then
echo "Error: '$File' is not a pdf file. Ignoring."
continue
fi
Files[FileCountCurrent++]="$File"
done < <(find "$@" -type f -name '*.pdf' -print0 | sort -z --version-sort)
FileCountTotal="${#Files[@]}"
}
arg_check(){
if [[ "$FileCountTotal" = "0" ]]; then
gui_notify "ERROR: No PDF files found."
echo "Exiting..."
exit 1
fi
}
############## Checks #################
arg_compose_filearray "$@"
arg_check
################ Main #################
FileCountCurrent="1"
for File in "${Files[@]}"; do
echo "Opening file $FileCountCurrent of $FileCountTotal:"
echo "$File"
mupdf "$File" > /dev/null 2>&1
((FileCountCurrent++))
done
echo "Done."
Installation
Copy and paste the contents of the code box above into a new empty text file, save it, and mark the script as executable via the Properties menu of your file manager.
Make sure to install all dependencies:
sudo apt-get install mupdf
Usage
pdfwalker <pdf files or directories>
For instance:
pdfwalker "~/Downloads/PDF" "~/Documents/Scans"
The script will recursively find all PDF files in the selected directories and open them one after another with mupdf
. To switch to the next file in line, simply close the current mupdf
window (Q). If you want to exit the script completely you can terminate it from the terminal via CTRL +C.
sudo apt-get install impressive
returnsE: Unable to locate package impressive
. – sh37211 Jan 26 '22 at 17:13