[EMAIL PROTECTED] wrote:
> Hi all,
>       I have an issue which requires your help that is… I want to create a
>    PDF template on-the fly. Means I want to read data from text file. For
>    instance lets assume that I have following data in my text file.
> 
>    <XYZ CORP> CONTRIBUTOR’S AGREEMENT

It would have been easier if you had <XYZ_CORP />
instead of <XYZ CORP>. The latter isn't valid XML,
and therefore you can't take advantage of an already
existing XML parser.

>       I need to read this text on-the-fly and needs to create template.

Why create a template? Why not use the XML (supposing
you are allowed to change your example into a real XML
file) as template?

>    Once my template is ready, then I’ll get data from DB and ill
>    substitute.

Given the sample text you gave, that would be an example of
bad design. It will result in ugly PDFs because you probably
want flowing text. Using TextFields, you define a rectangle
at absolute positions. It won't adapt to the rest of the text.

So you will have sentences like this:
"of the twentieth day of Augustus, 2000"
and this:
"of the first     day of June    , 2000"
I bet you don't want to blanks in the second
sentence, but that's what you'll inevitably get.

>    How would I know absolute position of where
>    should I place my TextFiled object in the document.

If that's the question, have a look at the form example
in the book. I've inserted an example where I add a field
using a Chunk with a generic tag event. The field is added
in the implementation of the page event.
But please reconsider your design and learn more about PDf
first. I've done plenty of closed source projects similar
to yours, and I never used the design you suggest in your
question. Note that my projects are closed source, I can't
send you any source code.
br,
Bruno

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to