You're throwing a Rather Large chunk of code at us and then expecting us to execute it (on our own servlet-capable server) to get the resulting PDF. That's fine for commercial support, but that's not what this mailing list is for. I suggest you remove the PDF code from your servlet code. Get it working "stand alone" with basic file I/O first, then wrap it in a servlet.
Having said that, nothing in your code is jumping out at me as The Problem: //This would simulate the pdf we would display to customer to fill out InputStream is = getServletContext().getResourceAsStream("wwwroot/sample2.pdf"); // We create a reader with the InputStream PdfReader reader = new PdfReader(is, null); // We create an OutputStream for the new PDF ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Now we create the PDF PdfStamper stamper = new PdfStamper(reader, baos); // We get submit button from existing form and change the submit properties of which AcroFields form = stamper.getAcroFields(); PushbuttonField button = form.getNewPushbuttonFromField("ScalepointButton"); PdfFormField submit = button.getField(); submit.setAction(PdfAction.createSubmitForm("http://localhost:8084/PDFFo rms/CapturePdf?category=" + category, null, PdfAction.SUBMIT_PDF)); form.replacePushbuttonField("ScalepointButton", submit); stamper.close(); // We write the PDF bytes to the OutputStream OutputStream os = response.getOutputStream(); baos.writeTo(os); os.flush(); --Mark Storer Senior Software Engineer Cardiff.com import legalese.Disclaimer; Disclaimer<Cardiff> DisCard = null; ________________________________ From: n...@scalepoint.com [mailto:n...@scalepoint.com] Sent: Wednesday, August 24, 2011 5:51 AM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] How to update A PushbuttonField on an existing PDF Hi iText, First of we are very much interested in using this application to our product. Currently we are new to this and still testing this if it could cater our needs. What I'm trying to do is to get an existing PDF as stream, then setting the url of a pushbutton field that is already existing in the PDF, then showing that PDF with the modified action. The PDF is displayed but there was no change in the button. Could you please point me on the right direction on this. I have attached here the PDF file and the Servlet that supposed to display the pdf with the modified button. Your help would be greatly appreciated. Thanks, Nelson ------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev _______________________________________________ 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