devanand jamisetti wrote:
Hello Bruno,
Attached are the files with modified1.pdf
containing a short string and
modified.pdf containing the long string. Rather than reducing the long
string font and fitting it into the same text field, is it possible to
fill the extra string into the next page using same template.?
You could measure the String (Chunk.getWidthPoint()) http://itext.sourceforge.net/examples/com/lowagie/examples/objects/chunk/Width.java and decide if a new page is needed,
BUT: (1) you are using PdfStamper and PdfStamper doesn't allow you to add pages.
(2) You are using an existing form, you get the AcroFields from that form.How do we create the extra template before hand since we dont know how much data is coming from the database.
There is only one address field. You can't have two fields with the same name in one form.
So even if you could add pages with PdfStamper, you wouldn't be able to use simple methods
such as setField(). You would have to get the absolute position of the field and add text at
those positions. In short: program your own custom PdfStamper based on your own needs.
I think you are just demanding too much. It's not impossible to achieve what you want,I mean the number of pages it takes.( if the data is more than that can fit into a text field then the extra data should go into a new page with same field and so on....
any suggestions or examples would be helpful..
but it's not possible with only 10 lines of code as is done in your example.
It demands a custom approach and that's generally not the type of questions I answer.
I forward this to the mailing list.
br,
Bruno
------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions