Created
November 25, 2013 15:25
Revisions
-
jupeter created this gist
Nov 25, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ #!/bin/bash # Script to convert PDF - create flatten PDF file # # Format: # ./convert input-file.pdf output-file.pdf # # Dependencies: # * pdftk # * imagemagick PDF=$1 OUT_PDF=$2 DENSITY=300 echo "Processing $PDF" DIR=`basename "$1" .pdf` echo ' Converting pages to JPEG files...' pdftocairo -r $DENSITY -jpeg $PDF /tmp/convert-"$DIR" echo ' Merge JPEG files into one PDF' convert -density $DENSITY /tmp/convert-"$DIR"* $OUT_PDF rm /tmp/convert-"$DIR"* echo 'All done'