For a recent job application, I needed to combine several pdf files into a single one and to number its pages afterwards. I already knew that I would be able to use PDFtk, a smart CLI tool I mentioned in a previous note to combine the pdf files, but I was not sure how to proceed for the page numbering. Turns out that PDFtk is also useful for this too!
To install pdftk on Ubuntu (or Debian) and MacOS, you should look for pdftk-java
:
|
|
Once installed, it is relatively easy to find short tutorials that explain how to combine pdf
files with PDFtk, for instance, there is a very good one on Make Tech
Easier.
Basically, it is a simple call to the command cat
of PDFtk:
|
|
For the page numbering, I found this post by Dr. ChloƩ-Agathe
Azencott.
Following Dr. Azencott did, I created number.tex
(see below), an empty document with pages numbered (my final document had 15
pages):
|
|
Then I called pdflatex
to obtain number.pdf
with the desired 15 pages:
|
|
Then I used the multibackground
argument of PDFtk concisely introduced in the
documentation :
|
|
Finally, I combined these two steps in the following
makefile so that I could rebuild my application with make
:
|
|
Hope this could be useful!