As I said earlier, I have to stop writing the tutorial for a while, which is a pity. I have a new project at the University: I need to generate cards in PDF that can be used as a pass for students. On the pass there will be textual information (name, address,...), the matriculation number should be displayed as a barcode and the card should also show a photograph of the student.
You are basically describing a special case of "variable data printing" - something that a variety of folks (myself included) have used iText for with much success.
If I would do this using my current knowledge of iText, I would generate every card from scratch and add all the data at absolute places (with some formatting). But maybe there's a better way. Suppose I let the 'art department' design a card template with an acroform. How would I be able to fill this card?
AcroForms are a much better approach to the problem - even if only as a placeholder. We do this with a VDP solution that we've deployed.
Customer builds templates with form fields, and then feeds our tool that template and an XML grammar with info about what to fill in each field - rich text, images or other PDFs.
My first idea would be to read the PDF, get all the field locations and add the new data at absolute positions (the PdfStamper solution).
That's what we've done.
The reason this works out better than using the standard AcroForm APIs is that it's consistent regardless of data type (text vs. image) _AND_ it gives you more flexibility for what to place in those "boxes". For example, we were able to do "rich text" fields this way by using the iText XML grammar and some interesting "hacking" of the source...
If I can achieve all this with forms, it would make a great user-case to add to the tutorial.
Definitely!
Leonard
--------------------------------------------------------------------------- Leonard Rosenthol <mailto:[EMAIL PROTECTED]> Chief Technical Officer <http://www.pdfsages.com> PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax)
------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
