Abhishek Srivastava wrote:

Hello All,

In MS word we can define a template with bookmarks. When the word document is opened, I can just search for the bookmark and assign some text against the bookmark.

This makes generating documents pretty easy as I don’t have to write pixel based insertion of text and images. I can just locate the bookmark and assign a value to it.

Was just wondering can this be done in PDF and iText, create a PDF template with these place holders, then just open the pdf document using itext search for these bookmarks and assign them values and then save the document.

Currently I am writing text in pixel mode, but its very complex because I have to adjust the starting postion based on the length of the string and size of the font.

Excuse me if you get this answer twice, I am working through an
enormous backlog of mail.

If you create a PDF with an AcroForm.
You can have text fields.
These field can be filled with String values very easy.
There's an example here:
http://article.gmane.org/gmane.comp.java.lib.itext.general/20066/match=setfield
In the example, I even 'flatten' a field.

If you want the font size to adjust automatically so that
iText adjusts the text to fit into the field, define a text field
with font size zero.

If you want place holders for images, please take a look
at the example in this post:
http://article.gmane.org/gmane.comp.java.lib.itext.general/20873

br,
Bruno



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to