cancel
Showing results for 
Search instead for 
Did you mean: 

PDF is not an interactive form. Data cannot be exported from it

Amey-Mogare
Contributor
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Amey-Mogare
Contributor
0 Kudos

Closed due to no replies for many days