From 4ae9a0940ceb3bc2ed1dfdd90a8990fbe15e92ef Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 13 Nov 2010 18:50:22 -0300 Subject: [PATCH] The eda-tools welcome the arrival of fpd2pdf - fpd2pdf/fpd2pdf: footprint pretty-printer - README: list fpd2pdf - README: licensing terms may also be just in the file in question, if there's only one --- README | 5 ++++- fpd2pdf/fpd2pdf | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 fpd2pdf/fpd2pdf diff --git a/README b/README index 08f9d32..03851ab 100644 --- a/README +++ b/README @@ -10,8 +10,11 @@ This is a collection of utilities for Electronic Design Automation: - dsv: data sheet viewer. A simple but efficient system for caching data sheets and displaying them with xpdf from command line. +- fpd2pdf: convert a set of footprints (made with FPED) into a + reviewer-friendly PDF. + - schhist: a system to walk a KiCad project's git revision history and generating Web-browseable graphical differences of the schematics. Each utility can have its own licensing terms. They're specified in the -respective directory. +respective directory or in the file itself. diff --git a/fpd2pdf/fpd2pdf b/fpd2pdf/fpd2pdf new file mode 100755 index 0000000..c67bc98 --- /dev/null +++ b/fpd2pdf/fpd2pdf @@ -0,0 +1,46 @@ +#!/bin/bash +# +# fpd2pdf - Print a set of Fped files into a PDF +# +# Written 2010 by Werner Almesberger +# Copyright 2010 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 <&2 +usage: $0 [-a] [-o out.pdf] file.fpd ... + + -a also include files whose name contains a tilde (backup files) + -o out.pdf write to the specified file (default: standard output) +EOF + exit 1 +} + + +out=- +all=false + +while true; do + case "$1" in + -a) all=true + shift;; + -o) [ -z "$2" ] && usage + out="$2" + shift 2;; + -*) 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 \"$n\" -)"; done`