Guest User

Convert scanned page images to PDF files using JPEG2000 compression.

a guest
Jan 19th, 2025
44
0
168 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | Software | 0 0
  1. (FILE_EXT="png"; JP2Q="40";
  2.     find -type f -name "*.$FILE_EXT" -print0 | \
  3.         xargs -0 -P 4 -I {} \
  4.             bash -c 'FILE_BASE="${3%.$1}";
  5.                      opj_compress -q "$2" -i "$3" -o "$FILE_BASE.jp2" && \
  6.                     img2pdf --pdfa --imgsize 600dpix600dpi --output "$FILE_BASE.pdf" "$FILE_BASE.jp2" && \
  7.                     rm -f "$FILE_BASE.jp2"' _ "$FILE_EXT" "$JP2Q" {})
  8.  
Advertisement
Add Comment
Please, Sign In to add comment