PDF tools

Add header/footer

Stamp a header and/or footer line on every page. {page} and {total} are live.

Runs on your device. The file is never uploaded.

Add header/footer stamps one line onto each PDF page at the top and another at the foot, both centred in Helvetica. The size defaults to 10, and writing {page} or {total} in either line substitutes the current page number and the document total. The match is case-sensitive, so {Page} is drawn as typed.

Input

Options

Questions

How do I put the page number in the text?

Type {page} where you want it and {total} for the page count. Both are replaced per page, so "Page {page} of {total}" comes out as Page 4 of 12 on the fourth page of a twelve page document. Every other character is literal, so there are no other placeholders and nothing else is substituted.

Can I set only a footer?

Yes, either field on its own is fine. Leaving both blank is refused with "give a header, a footer, or both", since there would be nothing to stamp. Both lines are centred horizontally: the header sits 24 points plus the font size below the top edge, and the footer sits 24 points up from the bottom.

Does it upload my document?

No. pdf-lib loads the file, draws the lines and saves it, all in a Web Worker in this tab. Nothing is transmitted, nothing is retained, and there is no account. You can watch the request counter stay at zero, or disconnect and stamp anyway.

Can I stamp only some pages, or change the position?

No on both counts. Every page in the document gets the same header and footer, and the positions are fixed at centre top and centre bottom. The only setting for appearance is the font size, which defaults to 10. The text is drawn in Helvetica, in black.

Can I use this and Add page numbers on the same file?

You can, but they will overlap. Both draw centred at 24 points from the bottom of the page, so a footer here lands on top of a page number added there. Pick one: this tool already has {page} and {total}, so a footer of "{page}" does what Add page numbers does.

What comes back?

One file per PDF you dropped, named with a -headed suffix, so report.pdf gives report-headed.pdf. Drop a whole batch and each is stamped with the same header and footer separately, with {total} resolved against each document's own page count. Your originals are not modified.

Related PDF tools