Skip to Content
Former Member
Jul 22, 2009 at 07:59 PM

On opening PDF URL: Error The file is damaged and could not be repaired



I am trying to open a PDF file in WebDynpro by opening it in an external window. I am getting this pdf content via one RFC in BINARY format. We are able to download and see the file from SAP. But as we open it in the external window (browser window) through WebDynpro code, it gives a pop up message "The file is damaged and could not be repaired"

I have used the following code to achieve this fuctionality:

First I have executed the RFC and have got binary data, then:

After this I am getting the PDF file content and try to open it by using IWDWebResource as:

byte [] pdfContent= wdContext.currentI_File_PDFElement().getLine();

wdComponentAPI.getMessageManager().reportSuccess("Old RFC VAL in binary::"+pdfContent+" new "+wdContext.currentI_File_PDFElement().getLine()); 

                   IWDWebResource pdfResource = WDWebResource.getWebResource(pdfContent, WDWebResourceType.PDF); 

Even this also on clicking the link to action gives the same pop up message: the file is damaged and could not be repaired. I have tried using IWDWebCachedResourse also but to no use.

If anyone's having any idea or suggestions over this scenario, kindly help.

Helpful answers will be appreciated.