web20opensource / stamper

Java itext stamper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stamper

Java itext stamper

#Java code to stamp text in a pdf (manipulate) using the famous itext PdfStamper

  • First. Tested in eclipse indigo
  • Second. I'm based on this tutorial http://www.vogella.com/articles/JavaPDF/article.html
  • Third. Just download the itextpdf-5.4.2.jar from http://itextpdf.com/ and the tarball http://itextpdf.com/examples/ with the book examples (see Resources below).
  • Fourth. Create the project whatever the name you want
  • Fifth. Add the itextpdf-5.4.2.jar to the proyect http://www.vogella.com/articles/Eclipse/article.html#classpath
  • Sixth. Add the Stamptext.java (I worked under the book examples packages - package part2.chapter06;). The book examples also contains a Stamptext.java, my version is a little bit different from original. Just clone this git inside chapter06.
  • Seventh. Get some pdfs from everywhere. myPdfSheets.pdf is the pdf whit various sheets which you are interested in. leyend.pdf is the text that you want to stamp, check the absolute position. Finally myPdfSheets_stamped.pdf is the result.

#Resources

Go to the library and get a copy from "itext in Action, Second Edition" - BRUNO LOWAGIE (Page 173)

About

Java itext stamper