FR |
Damien Roque > Merge PDF files and add page numbers

Merge PDF files and add page numbers

lundi 15 décembre 2014.

When dealing with administrative paperwork, it is usually desirable to merge several PDF files and optionally add page numbers to the output PDF document. A solution based on Makefile and a BASH script is proposed here.


The following dependencies have to be resolved :

  • make
  • pdftk
  • gs
  • enscript
    Notice that the prerequisites are usually provided as packages with common GNU/Linux distributions.

Download and execution

Download and unzip the file.

Zip - 133.6 ko

Go into the directory and type make. A directory out should have been created with the following content :

  • sortie.pdf is the concatenation of the PDF files provided in the parent directory.
  • sortie-num.pdf is a page-numbered version of the previous file.
  • sortie-num-comp.pdf is a compressed version of the previous file.

If the result of this run is correct, replace example PDFs by yours.

SPIP | | Suivre la vie du site RSS 2.1