PDF and PDF/A postprocessing
This commit is contained in:
parent
f5e639f59c
commit
fc7127b769
1 changed files with 46 additions and 10 deletions
56
Makefile
56
Makefile
|
@ -36,25 +36,61 @@ texInt: $(texFilesInt)
|
||||||
# Recipes #
|
# Recipes #
|
||||||
###########
|
###########
|
||||||
|
|
||||||
compile = pandoc \
|
compile_md = pandoc \
|
||||||
$(1) \
|
$(2) \
|
||||||
--standalone \
|
--standalone \
|
||||||
--from markdown \
|
--from markdown \
|
||||||
--to latex \
|
--to $(1) \
|
||||||
--template lenaisten \
|
--template lenaisten \
|
||||||
--variable colorlinks:true \
|
--variable colorlinks:true \
|
||||||
--variable csquotes:true \
|
--variable csquotes:true \
|
||||||
--variable lang:de-DE \
|
--variable lang:de-DE \
|
||||||
--output $(2)
|
--output $(3)
|
||||||
|
|
||||||
|
GSFLAGS := \
|
||||||
|
-sDEVICE=pdfwrite \
|
||||||
|
-dNOOUTERSAVE \
|
||||||
|
-dNOPAUSE \
|
||||||
|
-dQUIET \
|
||||||
|
-dBATCH
|
||||||
|
|
||||||
|
postprocess_pdf = gs \
|
||||||
|
$(GSFLAGS) \
|
||||||
|
-sPAPERSIZE=a4 \
|
||||||
|
-dFIXEDMEDIA \
|
||||||
|
-dPDFFitPage \
|
||||||
|
-dCompatibilityLevel=1.7 \
|
||||||
|
-dPDFSETTINGS=/ebook \
|
||||||
|
-sOutputFile=$(2) \
|
||||||
|
$(1) \
|
||||||
|
2>/dev/null
|
||||||
|
|
||||||
|
convert_pdfa = /opt/pdfa/bin/gs-919-linux_x86_64 \
|
||||||
|
$(GSFLAGS) \
|
||||||
|
-dPDFA=2 \
|
||||||
|
-sProcessColorModel=DeviceRGB \
|
||||||
|
-dPDFACompatibilityPolicy=1 \
|
||||||
|
-sOutputFile=$(2) \
|
||||||
|
/opt/pdfa/PDFA_def.ps \
|
||||||
|
$(1) \
|
||||||
|
2>/dev/null
|
||||||
|
|
||||||
|
md2pdf = $(call compile_md,pdf,$(1),-) | $(call postprocess_pdf,-,$(2))
|
||||||
|
|
||||||
|
md2pdfa = $(call md2pdf,$(1),-) | $(call convert_pdfa,-,$(2))
|
||||||
|
|
||||||
|
# pdf
|
||||||
|
|
||||||
%$(suffixPub).pdf: %.md lenaisten-defs.sty
|
%$(suffixPub).pdf: %.md lenaisten-defs.sty
|
||||||
python3 ./redact.py $< | $(call compile,-,$@)
|
python3 ./redact.py $< | $(call md2pdfa,-,$@)
|
||||||
|
|
||||||
%$(suffixPub).tex: %.md lenaisten-defs.sty
|
|
||||||
python3 ./redact.py $< | $(call compile,-,$@)
|
|
||||||
|
|
||||||
%$(suffixInt).pdf: %.md lenaisten-defs.sty
|
%$(suffixInt).pdf: %.md lenaisten-defs.sty
|
||||||
python3 ./redact.py -i $< | $(call compile,-,$@)
|
python3 ./redact.py -i $< | $(call md2pdfa,-,$@)
|
||||||
|
|
||||||
|
# tex
|
||||||
|
|
||||||
|
%$(suffixPub).tex: %.md lenaisten-defs.sty
|
||||||
|
python3 ./redact.py $< | $(call compile_md,latex,-,$@)
|
||||||
|
|
||||||
%$(suffixInt).tex: %.md lenaisten-defs.sty
|
%$(suffixInt).tex: %.md lenaisten-defs.sty
|
||||||
python3 ./redact.py -i $< | $(call compile,-,$@)
|
python3 ./redact.py -i $< | $(call compile_md,latex,-,$@)
|
||||||
|
|
Loading…
Reference in a new issue