Skip to content

Commit

Permalink
Make pdf with links
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed Dec 2, 2016
1 parent 80b53b1 commit 148400c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions keeplinks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
sed -n '
/%!/,/beginpage$/p
/\[ \/Rect/,/pdfmark/p
/^endpage/,/%%EOF/p
'
9 changes: 8 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
DOTFILES = $(basename $(wildcard *.dot))

all: $(addsuffix .jpg, $(DOTFILES)) $(addsuffix .svg, $(DOTFILES))
all: $(addsuffix .jpg, $(DOTFILES)) $(addsuffix .svg, $(DOTFILES)) $(addsuffix .pdf, $(DOTFILES))

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

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

%.pdf: %.dot
dot "$<" -Tpdf -o main.pdf -Tps2 -o main.ps2
sh keeplinks.sh < main.ps2 > link.ps2
ps2pdf link.ps2 link.pdf
cpdf -stamp-on link.pdf main.pdf -o $@
rm main.pdf main.ps2 link.ps2 link.pdf

clean: rm *.jpg *.svg

0 comments on commit 148400c

Please sign in to comment.