cancel
Showing results for 
Search instead for 
Did you mean: 

save the adobe form

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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);

}