Ambika,
Yesterday I put together a servlet to accomplish a similar task. The following code snippet gets the submitted PDF from the HTTP request input stream, calls Forms ES to render the PDF, gets the attachments from the rendered PDF, and iterates over the attachments. I added comments in the while loop, below, to indicate possible actions.
...
Document formIn = new Document(req.getInputStream());
RenderOptionsSpec renderOptionsSpec = new RenderOptionsSpec();
renderOptionsSpec.setLocale("en_US");
FormsResult formOut = formsServiceClient.processFormSubmission(formIn,
"CONTENT_TYPE=application/pdf",
"",
renderOptionsSpec);
List fileAttachments = formOut.getAttachments();
Iterator iter = fileAttachments.iterator();
int i = 0 ;
while (iter.hasNext()) {
Document fileAttachment = (Document)iter.next();
// do DB processing or validate the attachments using...
// File myFile = new File("C:\\attachment" + i + ".pdf");
// fileAttachment.copyToFile(myFile);
i++ ;
}
...
Steve