cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive Form with images from KM ??

Former Member
0 Kudos

hello: I need to read an image from km to incorporate it in Interactive Form, but for some reason when being generated the Form does not show it. The subject to dynamically obtain the images from km.

Thank you very much.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

Please review this link to import a KM image:

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/kmc/getting%2ban%2bimage%2bfrom%2bkm%2bdocument%2...

Now you must put the image to an attribute of context of type string. For it you do the following thing:

...

//Reading the image file......

BufferedInputStream bufIn = new BufferedInputStream(resourceimg.getContent().getInputStream());

byte[] imagebyte = new byte[bufIn.available()];

bufIn.read(imagebyte);

//Convertir a String

String imgString=new BASE64Encoder().encode(imagebyte);

wdContext.currentContextElement().setImgString(imgString);

...

Finally, in the Form you must add a Image Field, with the following properties:

-Tab field

  • URL: empty

  • Embebed Image Data

- Tab Binding

  • Default Binding: $record.ImgString

That is.

Regards

Former Member
0 Kudos

it works perfect. thanks

Former Member
0 Kudos

it is possible to transfer the content of the image in format XML (serializer).

In the tests it has been without problems, (1) now single it is to know like turning the image to XML JAVA and passing that value to the Node.

(1) I have taken the content result from the “Embed Image Data” and I have passed it like parameter from the Node to Adobe Form, and works!!!.

-The idea is to bring the image from km.

...