6

I have a PDF file and I wish to add on the footer of all pages (except the first two) a line of plain text (not a logo or something alike).

Did anyone has an example of how this can be done (in any language)?

Update: The original PDF was made with Scribus and I have total control of it. So if it easier to make a find&replace operation, that's fine too.

Roger
  • 8,286
  • 17
  • 59
  • 77

2 Answers2

6

If "the footer" is defined by a position (i.e. specified in millimeters for example), you can just use your favorite language (TeX, PHP, FPDF, Postscript, ...) to render a PDF containing the two lines and then overlay this PDF on top of your existing PDF using pdftk.

If you want to apply the overlay only to the first two pages, you have to use a temporary file like this:

pdftk input.pdf stamp overlay.pdf output temp.pdf
pdftk A=input.pdf B=temp.pdf cat A1-2 B3-end output result.pdf
AndreKR
  • 32,613
  • 18
  • 106
  • 168
  • Sorry, I ment pages. thank you for the tip, I'll try and post the results. – Roger Oct 12 '11 at 21:52
  • 1
    All I want is to insert plain text (not a logo or something alike). I guess I'd have to substitute the "stamp overlay.pdf" for another command. Would you know what it is? – Roger Oct 13 '11 at 09:30
  • No, you have to create a PDF to overlay it. Think of a PDF as an image: You have to render the text first. Should be quite simple with the tools I named. – AndreKR Oct 13 '11 at 12:07
  • So in overlay.pdf, I'd have the text I want to insert, is it? – Roger Oct 14 '11 at 01:12
  • check this out: https://stackoverflow.com/a/64385770/6723250 – xeruf Apr 12 '23 at 08:26
0

If you have the Scribus file you can use masterpages.

http://wiki.scribus.net/canvas/Working_with_Master_Pages

Alexander Baltasar
  • 1,044
  • 1
  • 12
  • 25