cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding open pdf files

Former Member
0 Kudos

Dear Frds

I have to open a pdf file when i click the button...

the pdf file should be kept in the application

using webdynpro....

How to keep the pdf file in my application

or how to keep pdfile resource in server....

Thanks in advance

G .kumar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Shravan,

I suggest storing the PDF inside your mimes folder and if you have to internationalize it apply two-letter for the different countries (en, fr, es, it, ...).

Create a context element of type IWDResource to map document to, generate the url with the following code and add the content of your context element to a FileDownload ui element.


		String currentFileName = "MYFILE.pdf";     
		String resourcePath = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), currentFileName);
		
		IWDResource resource = WDResourceFactory.createCachedResource(new FileInputStream(new File(resourcePath)),
			currentFileName, 
			WDWebResourceType.PDF,
			true
		);
		
		wdContext.currentContextElement().setFileResource(resource);

regards,

Christian

sid_sunny
Contributor
0 Kudos

Hi Shravan,

Instead of button use FileDownload UI element to do this. Refer to this [PDF|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71] for any reference on FileDownload UI element usage.

Regards

Sid

Edited by: siddharth chauhan on Jan 14, 2008 2:41 PM