this guy says enscript worked 'like a charm': http://www.dry-lab.org/blog/2018/numbering-pages-of-a-pdf but it wiped my pdf - producing page numbers on blank pages

id rather use something like pdfsam: https://userguide.pdfsam.org/Public/Default.aspx? "With the Page Number function, you can insert page numbers in the document" - but that is for pdfsam 'enhanced' and only 'basic' and 'visual versions are available for linux

when i search the web for a solution most answers relate to 'adding pages to pdf' and not 'adding page numbers', thus i can't find good info. The Q was asked mostly 10 years ago it seems, implying that it has recently become straightforward?

  • I'm sure this can be done in LibreOffice Draw. Inserting page numbers definitely works but I'm not sure how to automate it in a simple way for every page. It has some sort of master page template system and it could also be scripted I'm sure.
    – CR.
    Mar 17, 2022 at 18:04

1 Answer 1


This was the best answer i found:


Use the LaTeX code given at the bottom and run pdflatex numbered.tex.

I modified the code slightly to end up with:

\documentclass[twoside, a4paper, 12pt]{article}





Eg, I position the page number at the top, in the left and right for even and odd pages respectively, following this advice:

Using LaTeX in this way seems simpler and gives more control over the output compared with enscript.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .