Hey guys,

I am trying to modify an existing PDF doc using PDFStamper, but it's
not working. I have used PDFStamper before to add javascript.
This time I am trying to modify contents of a field...Any ideas

byte[] pdfData = dcxt.getDocData();

                  log.fine("retrievd pdfData from session");

                  PdfReader reader = new PdfReader(pdfData);

                  ByteArrayOutputStream bos =

                        new ByteArrayOutputStream(pdfData.length);

                  PdfStamper stamp = new PdfStamper(reader, bos);

                  stamp.setViewerPreferences(PdfWriter.HideToolbar);

                  AcroFields form1 = stamp.getAcroFields();

                  form1.setField("tbCoBuyer1SignaturePage5",
"SIGNATURE ELEMENT A");

                  stamp.close();

                  if (pdfData != null) {

                        log.fine("pushing data to browser");

                        response.setHeader("Content-Type", "application/pdf");

                        //response.setContentLength();

                        OutputStream os = response.getOutputStream();

                        bos.writeTo(os);

                        os.flush();

                        os.close();

                  }

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to