on 10-10-2006 2:50 AM
Folks,
How to save pdf doc to harddisk programatically in webdynpro application.
Thanks,
Manish
Hi Manish,
You can save the PDF in your local hard disk by adding the below mentioned piece of code under the action of any particular button,outside the PDF.
// Coding in the view side.
IPrivate<ViewControllerName>.IContextElement currentContext = wdContext.currentContextElement();
// to obtain the context -
byte[] bytes = currentContext.getPdfSource();
// The context attribute mapped to the pdfSource must be used to retrieve the path
try{
String filepath = "Provide your local path
(Ex: C:
PDF
SAVE
sample.pdf)";
File file = new File(filepath);
FileOutputStream Output = new FileOutputStream(file);
Output.write(bytes);
Output.close();
}
catch(Exception e)
{
e.printStackTrace();
}
This code should be run on the click of the button.
Kindly award points, if the solution/code provided achieve your requirement.
Regards,
Sharath
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 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.