blob: 475bf4d8b4c6dd4226acd153fed26f6efdec3f60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/zsh -e
PAPERSIZE=`lpoptions -p lbla -l|sed --silent 's/^PageSize.*\*//p'`
DIMENSIONS=`rgrep "$PAPERSIZE" /etc/cups 2>/dev/null|
sed --silent 's/.*PaperDimension.*["]\([0-9.[:blank:]]*\)"/\1/p'`
MARGINS=`rgrep "$PAPERSIZE" /etc/cups 2>/dev/null|
sed --silent 's/.*ImageableArea.*["]\([0-9.[:blank:]]*\)"/\1/p'`
echo "Dimensions in postscript points: $DIMENSIONS"
echo "Margins in postscript points: $MARGINS"
for value in `echo $DIMENSIONS $MARGINS`
do
echo "$value pt = $value pt * 300 dpi/72 pt/inch = $(( $value * 300 / 72 )) dots"
done
|