Hi
I am using PdfStamper to read a existing fillable PDF file, fill the form fields with values and display the filled PDF in browser. The following is an excerpt from my code
// Generate a outputFile Name by appending the timestamp
outputFile = getOutputFileName(object); // object here refers to the input pdf file
// Read the input PDF file
PdfReader reader = new PdfReader((String)object);
// Instantiate a PdfStamper with a outputfile name specified
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(outputFile));
// Get all the AcroFields from the file
AcroFields af = stamper.getAcroFields();
// Iterate through the List of Value objects and set them in AcroField
processFields(af, values);
stamper.close();
The above code would generate a new PDF file with values filled in. I would like to create this new PDF file in memory (using ByteArrayOutputStream etc) and display it on the browser to the user. I am using Struts Framework for the front-end.
If you could let me know some sample code that would create this file in memory and display in browser, that would be great.
Appreciate your help.
Thanks for your time.
Sendhil
--------------------------------------------------------- NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it.
============================================================================================
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
