You give us your text. We give you a quick link pointing to it. You keep your formatting.
quick snip
|
custom snip
|
about
|
create account / login
http://textsnip.com/77f005/vb
Change Code View:
plain text
html
css
xml
javascript
php
sql
ruby
python
csharp
vb
java
# !/bin/bash # This scipt takes an 8 page PDF as an argument and turns it into a single page PDF Pocketmod # It makes the following assumptions: # * First paramater is the name of an 8 page PDF file # * Second parameter is the name of the output file # # Example usage: # # ./pocketmod.sh input.pdf output.pdf # convert the PDF to individual PNG's echo "Starting the conversion of $1" convert $1 %d.png # Manipulate each PNG as necessary echo "Working on page 1..." mogrify -sample 800% -resize 12.5% -rotate -90 0.png echo "Working on page 2..." mogrify -sample 800% -resize 12.5% -rotate 90 1.png echo "Working on page 3..." mogrify -sample 800% -resize 12.5% -rotate 90 2.png echo "Working on page 4..." mogrify -sample 800% -resize 12.5% -rotate 90 3.png echo "Working on page 5..." mogrify -sample 800% -resize 12.5% -rotate 90 4.png echo "Working on page 6..." mogrify -sample 800% -resize 12.5% -rotate -90 5.png echo "Working on page 7..." mogrify -sample 800% -resize 12.5% -rotate -90 6.png echo "Working on page 8..." mogrify -sample 800% -resize 12.5% -rotate -90 7.png # Tile them together echo "Creating the first row..." convert +append 0.png 1.png row1.png echo "Creating the second row" convert +append 7.png 2.png row2.png echo "Creating the third row" convert +append 6.png 3.png row3.png echo "Creating the fourth row" convert +append 5.png 4.png row4.png echo "Assembling the complete document ..." convert -append row1.png row2.png row3.png row4.png total1.png # Resize the whole thing echo "Outputting to $2" convert total1.png $2 # clean up the mess rm *.png echo "Done! Kind regards, Hans de Zwart"