1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-29 15:25:54 +02:00

fpd2pdf: added option -P to select full-page drawings

This commit is contained in:
Werner Almesberger 2011-02-06 20:04:05 -03:00
parent ca29362534
commit e7a2cdce34

View File

@ -2,8 +2,8 @@
# #
# fpd2pdf - Print a set of Fped files into a PDF # fpd2pdf - Print a set of Fped files into a PDF
# #
# Written 2010 by Werner Almesberger # Written 2010-2011 by Werner Almesberger
# Copyright 2010 Werner Almesberger # Copyright 2010-2011 Werner Almesberger
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -15,10 +15,11 @@
usage() usage()
{ {
cat <<EOF 1>&2 cat <<EOF 1>&2
usage: $0 [-a] [-o out.pdf] file.fpd ... usage: $0 [-a] [-o out.pdf] [-P] file.fpd ...
-a also include files whose name contains a tilde (backup files) -a also include files whose name contains a tilde (backup files)
-o out.pdf write to the specified file (default: standard output) -o out.pdf write to the specified file (default: standard output)
-P use full page drawings
EOF EOF
exit 1 exit 1
} }
@ -26,6 +27,7 @@ EOF
out=- out=-
all=false all=false
p_opt=-p
while true; do while true; do
case "$1" in case "$1" in
@ -34,6 +36,8 @@ while true; do
-o) [ -z "$2" ] && usage -o) [ -z "$2" ] && usage
out="$2" out="$2"
shift 2;; shift 2;;
-P) p_opt=-P
shift;;
-*) usage;; -*) usage;;
*) break;; *) break;;
esac esac
@ -43,4 +47,4 @@ done
eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out -f \ eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out -f \
`for n in "$@"; do $all || [ "$n" = "${n/\~/}" ] && \ `for n in "$@"; do $all || [ "$n" = "${n/\~/}" ] && \
echo "<(fped -p \"$n\" -)"; done` echo "<(fped $p_opt \"$n\" -)"; done`