Hi, I'm fairly new with iText so I may sound silly somewhere. I'm working on (Lotus Notes-Java ) project where I've designed a blank pdf form interface using Adobe Acrobat 9 pro trial.This pdf will be attached in the configuration document as a template . When user will create a record on web interface and click "Attach template" button, My Java code will extract pdf in server's file system and will update pdf form fields from user entry and attach the pdf with the record as a attachment.Once done, It will remove template from the server file system.There are some more business logic but not require for now.
So far I can detach in server file system, But when trying to write user data to pdf fields it throws an error , http://itext-general.2136553.n4.nabble.com/file/n2718564/error.png Here is my Java class where I'm trying to update pdf form fields, import java.io.FileOutputStream; import lotus.domino.*; import com.itextpdf.text.pdf.AcroFields; import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.PdfStamper; public class pdfService { public void addHeaderToPdf(String filePath,Document webDoc)throws Exception { try { 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(); } catch(Exception e) { e.printStackTrace(); } } } Thanks, Rishi -- View this message in context: http://itext-general.2136553.n4.nabble.com/Suggestion-needed-to-implement-iText-for-Java-tp2718564p2718564.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
