on 04-08-2008 6:47 AM
hi expert
I have created the simple application in that i have created
open and save button , once i click the open button the adobe form will open
after that i want to save these adobe form in the particular location ("c:\temp")
how can i do this without using the upload and download UI element
help
its urgency
thanks
Regards
vijay
Hello Vijay,
You want save the pdf file to particular location..,So go through the following code. This might be useful to you.
IIWDAttributeInfo attInfo =
wdContext.currentContextElement().node().getNodeInfo().getAttribute("pdfsource");
ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
IModifiableSimpleValueSet binaryType =
type.getSVServices().getModifiableSimpleValueSet();
binaryType.put("FileName","TravelRequest.pdf");
binaryType.put("MimeType","WDWebResourceType.PDF");
String Filename =
"temp
webdynpro
web
local
offlineInteractiveForm
Components
com.sap.offlineinteractiveform.shital.UploadDownloadformComp
TravelRequest.pdf";
/* CONVERTS BINARY FILE TO A BYTE ARRAY */
try{
File file = new File(Filename);
FileInputStream in = new FileInputStream(file);
ByteArrayOutputStream out = new ByteArrayOutputStream();
int length;
byte[] part = new byte [10 * 1024];
while ((length = in.read(part)) != -1 )
{
out.write(part, 0, length);
}
in.close();
wdContext.currentContextElement().setPdfsource(out.toByteArray());
}catch(Exception e) {
throw new WDRuntimeException(e);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.