Showing results for 
Search instead for 
Did you mean: 

To Retrieve PDF Content as Binary format Via ODATA Adapter

0 Kudos

Hello Experts,

We're trying to consume a ODATA services via ODATA V4 Adapter to fetch PDF content as raw Binary format,but the services is sending some encoding characters(<½Óú¬µ„PÄO“VÅvz„LY•e“5)which is getting formatted as �<������P�O�V�vz�LY�e�5.

We have tried options in groovy to fetch the content as raw format via Reading payload as an, stream object:

referred this blog( and still receive the same content.

How can we set these parameters in the ODATA Receiver CPI Adapter or in Groovy to extract the UTF-8 format?

Please help to provide your Valuable inputs.

Thank You,


0 Kudos

Hi ezhilkumar_asaithambi !

I am encountering the same issue with a PDF file which I want to send to another application via API (as a multipart, not Base64 encoded). Could you find a solution? I would appreciate if you could share it!


Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Ezhilkumar,

Did you already try to read out the content like this?

import java.util.HashMap;
def Message processData(Message message) {
    def body = message.getBody();
    def bodyListCsv = body.readLines('windows-1252');
    return message;

In the following blog post I'm fetching a zip file holding a CSV file. And I'm converting/decoding it to the right format with the grooy script above. Maybe this can help. In case you are reading the content with a different encoding, you can pass it along, to obtain your result in the right format.

Kind regards,