tags:

views:

21

answers:

0

Hi,

I'm getting following error message while writing to the pdf fields.

Here is error screen, alt text

Here is the code,

                    PdfReader reader = new PdfReader(filePath); 

                    PdfStamper stamper = new PdfStamper(reader,new FileOutputStream(filePath)); 

                    AcroFields form = stamper.getAcroFields();     

                    form.setField("project_no", webDoc.getItemValueString("ProjectNo")); 
                    form.setField("project", webDoc.getItemValueString("ProjectName")); 
                    form.setField("client", webDoc.getItemValueString("Client")); 
                    form.setField("project_area", webDoc.getItemValueString("ProjectArea")); 
                    form.setField("pdf_psu_unid", webDoc.getItemValueString("ProjectID"));     

                    stamper.setFormFlattening(true); 

                    System.out.println("Successfully written"); 

                    stamper.close(); 

I will appreciate any help on this.

Rishi