Change Details
scripts/fpd2pdf |
1 | | #!/bin/bash |
2 | | # |
3 | | # fpd2pdf - Print a set of Fped files into a PDF |
4 | | # |
5 | | # Written 2010 by Werner Almesberger |
6 | | # Copyright 2010 Werner Almesberger |
7 | | # |
8 | | # This program is free software; you can redistribute it and/or modify |
9 | | # it under the terms of the GNU General Public License as published by |
10 | | # the Free Software Foundation; either version 2 of the License, or |
11 | | # (at your option) any later version. |
12 | | # |
13 | | |
14 | | |
15 | | usage() |
16 | | { |
17 | | cat <<EOF 1>&2 |
18 | | usage: $0 [-a] [-o out.pdf] file.fpd ... |
19 | | |
20 | | -a also include files whose name contains a tilde (backup files) |
21 | | -o out.pdf write to the specified file (default: standard output) |
22 | | EOF |
23 | | exit 1 |
24 | | } |
25 | | |
26 | | |
27 | | out=- |
28 | | all=false |
29 | | |
30 | | while true; do |
31 | | case "$1" in |
32 | | -a) all=true |
33 | | shift;; |
34 | | -o) [ -z "$2" ] && usage |
35 | | out="$2" |
36 | | shift 2;; |
37 | | -*) usage;; |
38 | | *) break;; |
39 | | esac |
40 | | done |
41 | | |
42 | | [ -z "$1" ] && usage |
43 | | |
44 | | eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out -f \ |
45 | | `for n in "$@"; do $all || [ "$n" = "${n/\~/}" ] && \ |
46 | | echo "<(fped -p \"$n\" -)"; done` |
Download the corresponding diff file