Last active
January 4, 2018 17:42
-
-
Save zhiyb/09b7b1d999541a5906b36ff82796d8ec to your computer and use it in GitHub Desktop.
Combine images into PDF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IN := $(sort $(wildcard pages/front*.png)) | |
IN += $(sort $(wildcard pages/prelim*.png)) | |
IN += $(sort $(wildcard pages/page*.png)) | |
OUT := $(IN:%.png=%.pdf) | |
PDF := $(shell basename "$$PWD" | sed 's/ /\\ /g').pdf | |
.PHONY: all | |
all: $(PDF) | |
#.SECONDARY: | |
.DELETE_ON_ERROR: | |
$(PDF): $(OUT) | |
pdftk $^ cat output "$@" | |
%.pdf: %.png | |
pdfjoin --outfile $@ $^ | |
.PHONY: clean | |
clean: | |
rm -f $(OUT) $(PDF) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment