on 03-19-2010 6:41 AM
Hi,
I am using following piece of code to read PDF data.
When I upload any PDF which was generated by Web Dynpro interactive forms, it accepts it and converts it into ByteStream.
But when I upload any other PDF, it gives following error:-
com.adobe.ProcessingException: PDF is not an interactive form. Data cannot be exported from it.
try {
IWDResource pdfResource = wdContext.currentContextElement().getCtx_va_pdfResource();
InputStream pdfInputStream = pdfResource.read(false);
int l_int_ResourceSize = pdfInputStream.available();
byte[] buffer = new byte[pdfInputStream.available()];
int l_int_NumOfBytesRead = pdfInputStream.read(buffer);
IWDPDFDocumentHandler pdfDocumentHandler = WDPDFDocumentFactory.getDocumentHandler();
IWDPDFDocumentAccessibleContext documentAccessibleContext = pdfDocumentHandler.getDocumentAccessibleContext();
documentAccessibleContext.setPDF(buffer);
IWDPDFDocument pdfDocument = documentAccessibleContext.execute();
ByteArrayInputStream dataInputStream = (ByteArrayInputStream) pdfDocument.getData();
}
catch (Exception e) {
myMessage.reportException(e.toString(), false);
}
Please help.
Thanks and regards,
Amey Mogare
Closed due to no replies for many days
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.