Skip to content

Commit 148400c

Browse files
committedDec 2, 2016
Make pdf with links
1 parent 80b53b1 commit 148400c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
 

‎keeplinks.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
sed -n '
3+
/%!/,/beginpage$/p
4+
/\[ \/Rect/,/pdfmark/p
5+
/^endpage/,/%%EOF/p
6+
'

‎makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
DOTFILES = $(basename $(wildcard *.dot))
22

3-
all: $(addsuffix .jpg, $(DOTFILES)) $(addsuffix .svg, $(DOTFILES))
3+
all: $(addsuffix .jpg, $(DOTFILES)) $(addsuffix .svg, $(DOTFILES)) $(addsuffix .pdf, $(DOTFILES))
44

55
%.jpg: %.dot
66
dot "$<" -Tjpg -o "$@"
77

88
%.svg: %.dot
99
dot "$<" -Tsvg -o "$@"
1010

11+
%.pdf: %.dot
12+
dot "$<" -Tpdf -o main.pdf -Tps2 -o main.ps2
13+
sh keeplinks.sh < main.ps2 > link.ps2
14+
ps2pdf link.ps2 link.pdf
15+
cpdf -stamp-on link.pdf main.pdf -o $@
16+
rm main.pdf main.ps2 link.ps2 link.pdf
17+
1118
clean: rm *.jpg *.svg

0 commit comments

Comments
 (0)
Please sign in to comment.