The closest case I came across in this site is this question: How can I personalize each copy of a PDF to add the reader's name or email address to each page?

However, I need something more advanced which is to add numbers to PDF containing gift vouchers. Here's what I want to do:

  1. Stamp the same PDF document with number, and save it with another filename.
  2. Each new PDF file will contain different numbers. BUT, all pages in 1 PDF file contains the same number.
  3. The numbers will be placed at 12 different locations each page (some with different layout e.g text rotation), and repeated for all pages; except the last page.
  4. The last page of the document will be stamped with the same number, but only in 9 different positions.

I managed to do the task using a PHP library SetaPDF-Stamper: http://www.setasign.com/products/setapdf-stamper/details/

But I need something more automatic (and preferably cheaper), since I need to create hundreds of PDFs.

I've been looking into various kind of PDF editor software (Windows applications), but they only support sequential and/or random numbering. While I need the same number to be stamped on the pages.

1 Answer 1


Maybe I don't understand the question, but if you can already do the job with SetaPDF-Stamper manually then all it takes is a little PHP code to do it automatically. There literally is no easier solution to your problem as described; to automate it will take custom code, period, and SetPDF-Stamper is the kind of library you would need for that purpose.

  • I never been really into PHP before, only using simple code such as contact form etc. So I'm struggling right now.
    – Arthz
    Commented Nov 11, 2014 at 4:46
  • Edit-The library I mentioned works exactly the way I need though I had a hard time trying to understand it. However, I can't help but amazed that no free/commercial software/application have this kind of features. Thanks for answering though, at least now I know that the library is my only option.
    – Arthz
    Commented Nov 11, 2014 at 4:54
  • 2
    @tomcam Welcome to the site! This answer would be more useful if you gave OP some guidance as to what to do with the PHP code. You don't need to write the code yourself, but it would be helpful if you could point out the relevant objects, methods, or functions for OP.
    – elixenide
    Commented Nov 11, 2014 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.