当前位置: 动力学知识库 > 问答 > 编程问答 >

php - PDF: insert a line of text into an existing PDF file

问题描述:

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.

网友答案:

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
网友答案:

If you have the Scribus file you can use masterpages.

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: