How to add pagenumber to pdf?

I found a webservice that does the job.

Tested with a 8 page pdf and it looks good.

Still looking for software to do this on linux thou.

Here is a guide that might work, using pdftk

The idea is to create a document containing pagenumbers only, then sort of overlay the numbered pages over the original document.

pdftk single_file.pdf multistamp numbers.pdf output single_document_numbered.pdf

Update: installed pdftk from official repo (extra). It’s a java-port of the original pdftk that was discontinued years ago.
For a test I created a document containing blank 10 pages using Libreoffice writer. Added footer with pagenumbers and exported as pdf. Then ran the command above with a 8 page document as original, and got a perfect result of 8 numbered pages (note that the page number document was 10 pages).