1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-23 05:48:06 +02:00
eda-tools/fpd2pdf/fpd2pdf
Werner Almesberger 47b53c8ef3 fpdoc: new utility to generate a PDF with the footprints used in a project
- fab/pos2fab: can be called with "do", to read .pos and .cmp file
- fpd2pdf/fpd2pdf: added syntax extension file.fpd:package to allow
  selection of a single package
- fpd2pdf/fpdoc: generate a PDF with the footprints used in a specific
  project
2011-03-23 04:34:06 -03:00

54 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#
# fpd2pdf - Print a set of Fped files into a PDF
#
# Written 2010-2011 by Werner Almesberger
# Copyright 2010-2011 Werner Almesberger
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
usage()
{
cat <<EOF 1>&2
usage: $0 [-a] [-o out.pdf] [-P] file.fpd[:package] ...
-a also include files whose name contains a tilde (backup files)
-o out.pdf write to the specified file (default: standard output)
-P use full page drawings
EOF
exit 1
}
out=-
all=false
p_opt=-p
while true; do
case "$1" in
-a) all=true
shift;;
-o) [ -z "$2" ] && usage
out="$2"
shift 2;;
-P) p_opt=-P
shift;;
-*) usage;;
*) break;;
esac
done
[ -z "$1" ] && usage
eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out -f \
`for n in "$@"; do $all || [ "$n" = "${n/\~/}" ] && \
echo "<(fped $p_opt \
\"\`echo \\"$n\\" | sed 's/:.*//'\`\" \
\`echo \"$n\" | sed 's/.*:/-1/p;d'\` \
-)"; done`