Hello everyone, im facing a problem here that I dont know how to solve. I
want to add form components to my table dynamically, for that, im following
this java that i found in a previous entry in the mailin list:
http://my-lab.googlecode.com/svn/trunk/iText/src/in_action/chapter16/RegisterForm1.java

It works perfectly, but when I try to reproduce it several times, to try
it, it creates the pdf, but the fields are not correct. I changed very few
of it. I am attatching it to the mail so you can see the work around.

This is the biggest change in the file:
        public static void createPdf(CheckList checkList) {
                // step 1
                Document document = new Document();
                try {
                        PdfWriter writer = PdfWriter.getInstance(document,
                                        new
FileOutputStream("C:\\Temp\\register_form" + new Random().nextInt() +
".pdf"));
                        document.open();

                        for (CheckListGroup g : checkList.getGroups()){
                            PdfFormField field =
PdfFormField.createEmpty(writer);
                            document.add(createTable(writer, field, g));
                            writer.addAnnotation(field);
                        }
                } catch (DocumentException de) {
                        System.err.println(de.getMessage());
                } catch (IOException ioe) {
                        System.err.println(ioe.getMessage());
                }
                // step 5
                document.close();
        }

Attachment: RegisterForm1.java
Description: Binary data

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to