Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. #!/bin/bash
  2. # Extracts image files from PDF files
  3.  
  4. if [ ! -f ${i} ]; then
  5.   echo "${i} does not exist!"
  6.   exit 1
  7. fi
  8.  
  9. pdf_file="${1}"
  10. directory="$(echo ${1} | sed -e 's/\.pdf$//')"
  11.  
  12. mkdir -p ${directory}
  13. pdfimages -j "${pdf_file}" "${directory}"/PDFImage
  14. if [ $? -eq 0 ]; then
  15.   echo "Images were successfully extracted!"
  16. else
  17.   echo "I failed"
  18. fi
  19.  
  20. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement