Forum Discussion

RohitBBorse's avatar
RohitBBorse
Contributor
14 years ago

Groovy script for decoding base64 string to an image(pdf)

Hi,

I wanted to decode base64 string to an image(pdf or png)

Originally, image type (pdf, png) is getting encoded into base64 file in xml response as below
<ns1:Label>
<ns1:Parts>
<ns1:DocumentPartSequenceNumber>1</ns1:DocumentPartSequenceNumber>
<ns1:Image>HOJBAAAElFTkSuQmCC.....</ns1:Image>
</ns1:Parts>
</ns1:Label>

I am trying to decode value from Image body to pdf or png.

Please suggest a groovy script for this.


Rohit