Extract Images

Examples

Extract all images of book.pdf into the current directory:

  1. pdfcpu extract -mode image book.pdf .
  2. extracting images from book.pdf into . ...
  3. ls
  4. -rwxr-xr-x 1 horstrutter staff 28K Mar 8 11:57 Im0_16_165.jpg*
  5. -rw-r--r-- 1 horstrutter staff 600B Mar 8 11:57 Im1_3_36.png
  6. -rw-r--r-- 1 horstrutter staff 93B Mar 8 12:06 Im91_22_601.png
  7. -rw-r--r-- 1 horstrutter staff 89B Mar 8 12:06 Im181_22_716.png
  8. -rw-r--r-- 1 horstrutter staff 93B Mar 8 12:06 Im37_22_782.jpg
  9. -rw-r--r-- 1 horstrutter staff 89B Mar 8 12:06 Im29_22_761.png
  10. -rw-r--r-- 1 horstrutter staff 76B Mar 8 12:06 Im124_22_539.png
  11. -rw-r--r-- 1 horstrutter staff 16K Mar 8 12:06 Im2_22_429.jpg
  12. -rw-r-----@ 1 horstrutter staff 537K Jun 9 2017 book.pdf

Extract all images of the first 5 pages of folder.pdf into out:

  1. pdfcpu extract -mode image -pages -5 folder.pdf out
  2. pageSelection: -5
  3. extracting images from folder.pdf into out ...
  4. ls out
  5. -rwxr-xr-x 1 horstrutter staff 26K Mar 8 12:10 Im0_1_2880.jpg*
  6. -rwxr-xr-x 1 horstrutter staff 10K Mar 8 12:10 Im0_2_7.jpg*
  7. -rwxr-xr-x 1 horstrutter staff 9.9K Mar 8 12:10 Im0_3_20.jpg*
  8. -rwxr-xr-x 1 horstrutter staff 5.1K Mar 8 12:10 Im0_4_33.jpg*
  9. -rwxr-xr-x 1 horstrutter staff 7.7K Mar 8 12:10 Im0_5_48.jpg*
  10. -rwxr-xr-x 1 horstrutter staff 11K Mar 8 12:10 Im1_2_8.jpg*
  11. -rwxr-xr-x 1 horstrutter staff 4.9K Mar 8 12:10 Im1_3_21.jpg*