makefile - Anybody else used `pdftk' and `make' together to merge PDF files together? -
this year came means of using pdftk' andmake' merge pdf files together. latest , refined iteration of makefile. note specific file names , directories have been changed did 1 @ work.
i've found works well, question has else used this, , have had problems kind of method?
here example makefile.
# makefile create build methods report, merging input source files # 1 big pdf. infile := reusable_component_library_-_evaulation_of_build_methods.odt outfile := report.pdf # pdf files assemble. handles := b c d e f g h j file_a := reusable_component_library_-_evaulation_of_build_methods.pdf file_b := makefile.recurse.pdf file_c := makefile.recurse_module.pdf file_d := makefile.nonrecurse.pdf file_e := user.mak.pdf file_f := makefile.semirecurse.pdf file_g := project.mk.pdf file_h := targets.mk.pdf file_i := module.mk.pdf file_j := modcomp.mk.pdf # page merge ranges. file_merge_ranges := a1-13 b a14 c a15 d a16 e a17 f a18 g a19 h a20 a21 j # computed file lists , file dependency lists. files := $(foreach a,$(handles),$(file_$(a))) file_handles := $(foreach a,$(handles),$(a)=$(file_$(a))) # pdf assembler pdftk := pdftk .phony: all: $(outfile) #file reusable_component_library_-_evaulation_of_build_methods.pdf: reusable_component_library_-_evaulation_of_build_methods.odt $(error file $@ not exist or older prerequisite(s) $^) # file b makefile.recurse.pdf: ~/workspace/ncu_procedural_approach/makefile.recurse $(error file $@ not exist or older prerequisite(s) $^) makefile.recurse_module.pdf: ~/workspace/ncu_procedural_approach/application/ate/makefile.recurse $(error file $@ not exist or older prerequisite(s) $^) # file c makefile.nonrecurse.pdf: ~/workspace/ncu_procedural_approach/makefile.nonrecurse $(error file $@ not exist or older prerequisite(s) $^) # file d makefile.semirecurse.pdf: ~/workspace/ncu_procedural_approach/makefile.semirecurse $(error file $@ not exist or older prerequisite(s) $^) # file e modcomp.mk.pdf: ~/workspace/ncu_procedural_approach/modcomp.mk $(error file $@ not exist or older prerequisite(s) $^) # file f project.mk.pdf: ~/workspace/ncu_procedural_approach/project.mk $(error file $@ not exist or older prerequisite(s) $^) # file g user.mak.pdf: ~/workspace/ncu_procedural_approach/user.mak $(error file $@ not exist or older prerequisite(s) $^) # file h targets.mk.pdf: ~/workspace/ncu_procedural_approach/targets.mk $(error file $@ not exist or older prerequisite(s) $^) # file module.mk.pdf: ~/workspace/ncu_procedural_approach/application/ate/module.mk $(error file $@ not exist or older prerequisite(s) $^) $(outfile): $(files) $(makefile_list) $(pdftk) $(file_handles) cat $(file_merge_ranges) output $(outfile) ##### end of file ##### as can see, document had large number of appendices. $(error strings out there because not using command line generate pdfs.
thanks in advance
Comments
Post a Comment