Les pages professionnellesdes enseignants chercheurs

Damien Roque

Merge PDF files and add page numbers

Mis à jour le

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.

En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies pour vous proposer des contenus et services adaptés OK
Pour accéder à toutes les fonctionnalités de ce site, vous devez activer JavaScript. Voici les instructions pour activer JavaScript dans votre navigateur Web.