@@ -6,6 +6,7 @@ The "paper" size does not change, just the elements are resized.
## Dependencies
The script uses `basename`, `cat`, `grep`, `bc`, `head` and `gs` (ghostscript).
You probably have everything installed already, except for ghostscript.
Optional dependencies are `imagemagick`, `pdfinfo` and `mdls` (Mac).
##### apt-get
```
@@ -19,17 +20,24 @@ sudo yum install ghostscript bc
```
brew install ghostscript
```
##### ImageMagick
As of version 1.2.7 ImageMagick was reintroduced as an optional way to get the first page size.
You will need to install imagemagick and have `identify` available on your `$PATH` to then use the `-i` parameter.
##### Optionals
From version 1.4.x I decided to create an adaptive method of getting the pagesize. It will try different methods if the previous one fails. People can also force a specific mode of operation with the `-m` parameter.
The order of operation is as follows:
1. Try to get `/MediaBox` with cat + grep
2. Failed AND MacOs ? Try mdls
3. Failed AND NOT MacOS ? Try pdfinfo
4. Failed ? Try ImageMagick's identify
5. Failed ? Exit with error message
The postscript/ghostscript method was removed until I can write a PS script that gets the page size.