cancel
Showing results for 
Search instead for 
Did you mean: 

byte declaration error

Former Member
0 Kudos

Hi experts,

can u solve my problem while creating an application for email interactive forms i am getting the error for the following code

byte[] pdfSource = bo.toByteArray();

newEmailNodeElement.setPdfsource(pdfSource);

element is not applicable for the arguments(byte[]).....

can anybody help me in that.....

thanks,

viswa

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

See this code - this the solution for converting the IWDResource to byte array. I think you get some idea.

InputStream l_is_FileStream = wdContext.currentContextElement().getUploadedFile().read(false);
int l_int_NoOfBytes = l_is_FileStream.available();
byte[] byteArray = new byte[l_int_NoOfBytes];
int l_int_byteRead = l_is_FileStream.read(byteArray, 0, l_int_NoOfBytes);

Regards,

Charan

Former Member
0 Kudos

I don't know if you can applicate this concept in your code, but instead you use a binary type, try to use a Resource type in your attribute pdfSource.

There is a link that use Resource object here:

[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71]

Regards

Marcos