cancel
Showing results for 
Search instead for 
Did you mean: 

open PDF-File (with LinkToURL or what?) !

Former Member
0 Kudos

Hello@all,

I have a PDF-File, which I have stored in my project like a image

(->src->mimes->Components->com.sap.....Comp--->Help.pdf

In the View of this Component I want to have a LinkToURL or something else to open the PDF file with adobe.

Can someone help me for this?

Best regards

Marcus

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can alternatively open Pdf using the following logic

String pdfLink = <Your Link>

FileInputStream fileIn = new FileInputStream(pdfLink);

int lastIndex = pdfLink.lastIndexOf(Constants.PATH_SEP);

String saveFileName = pdfLink.substring(lastIndex);

IWDResource resource = WDResourceFactory.createCachedResource(fileIn, saveFileName,WDWebResourceType.PDF,true);

String url = resource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal());

wdComponentAPI.getWindowManager().createNonModalExternalWindow(url,saveFileName).show();

Hope this helps.

Former Member
0 Kudos

With IFram it don't works.

But can you explain me easier your way (open Pdf using the following logic...)?

I#m not such a Java Expert. So my question is, what should I do step by step? Where should I write code in. what do I have to create? where should the PDF-file be stored?

Thank you.

Marcus

Former Member
0 Kudos

Hi

Insert a Iframe element and in the source give the file name.

It should show up within the space provided.

Do give comments if it works or not

Thanks

Srikant