<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Facing issue while Decoding Base64 Encoded PDF in CPI in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13952696#M4894513</link>
    <description>&lt;P&gt;&lt;FONT color="#000080"&gt;Hi Nagesh,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;Please find the sample Base64 Encoded PDF in the below link , after Decoding the file is showing as blank.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://acrobat.adobe.com/id/urn:aaid:sc:AP:20a22aa8-19dc-4204-b175-e6bbfefa5019" target="_blank"&gt;https://acrobat.adobe.com/id/urn:aaid:sc:AP:20a22aa8-19dc-4204-b175-e6bbfefa5019&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Dec 2024 04:07:36 GMT</pubDate>
    <dc:creator>das_sappo</dc:creator>
    <dc:date>2024-12-02T04:07:36Z</dc:date>
    <item>
      <title>Facing issue while Decoding Base64 Encoded PDF in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaq-p/13952132</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;I am trying to decode a Base64 Encoded pdf in CPI with the standard Base64 Decoder but it looks like the Decoder generating faulty PDF as after saving the content as .pdf it is not opening , showing document is damaged and can't open the file.&lt;/P&gt;&lt;P&gt;I tried to Decode the same Base64 string on Notepad++ and saved the decoded content as .pdf. The file is opening perfectly.&lt;/P&gt;&lt;P&gt;Even I tried replacing the Standard Decoder with Groovy but issue still persists, Please suggest how to resolve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arvik&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2024 05:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaq-p/13952132</guid>
      <dc:creator>das_sappo</dc:creator>
      <dc:date>2024-11-30T05:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Facing issue while Decoding Base64 Encoded PDF in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13952677#M4894508</link>
      <description>&lt;P&gt;Hi Arvik,&lt;BR /&gt;Can you please paste some sample payload that is being passed to the Base64 Decoder in Integration Suite ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 02:25:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13952677#M4894508</guid>
      <dc:creator>nageshrao</dc:creator>
      <dc:date>2024-12-02T02:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Facing issue while Decoding Base64 Encoded PDF in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13952696#M4894513</link>
      <description>&lt;P&gt;&lt;FONT color="#000080"&gt;Hi Nagesh,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;Please find the sample Base64 Encoded PDF in the below link , after Decoding the file is showing as blank.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://acrobat.adobe.com/id/urn:aaid:sc:AP:20a22aa8-19dc-4204-b175-e6bbfefa5019" target="_blank"&gt;https://acrobat.adobe.com/id/urn:aaid:sc:AP:20a22aa8-19dc-4204-b175-e6bbfefa5019&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 04:07:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13952696#M4894513</guid>
      <dc:creator>das_sappo</dc:creator>
      <dc:date>2024-12-02T04:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Facing issue while Decoding Base64 Encoded PDF in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13953383#M4894625</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Arvik,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Maybe I don't understand something here but the provided file is not Base64 encoded, it's a standard PDF file. So if you try to decode it then you receive incorrect data which are not a proper PDF file.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 17:11:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13953383#M4894625</guid>
      <dc:creator>Andrzej_Filusz</dc:creator>
      <dc:date>2024-12-02T17:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Facing issue while Decoding Base64 Encoded PDF in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13953395#M4894626</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;Hi Andrzej,&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&lt;FONT size="4"&gt;It's my bad as I shared the PDF file instead of the Base64 string.&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&lt;FONT size="4"&gt;I am getting this Base64 String from Source , I am performing a PUT call to update the Pdf file (binary) in Ariba.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;PUT call is successful and getting back the response but the PDF file is showing blank &amp;nbsp;after opening in ARIBA for this particular input file. Tested with few other input file and for them also the PDF not opening in ARIBA (showing can't open and file is damaged).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;Even we tried saving the body from HTTP call as pdf and that is also giving me error.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Similar issue&lt;/STRONG&gt;&amp;nbsp; -&amp;nbsp;&lt;A href="https://community.sap.com/t5/technology-q-a/send-pdf-through-sap-cpi-pdf-data-lost-after-message-reached-target/qaq-p/12408834" target="_blank" rel="noopener"&gt;https://community.sap.com/t5/technology-q-a/send-pdf-through-sap-cpi-pdf-data-lost-after-message-reached-target/qaq-p/12408834&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" color="#000080"&gt;STEP 1 : Base64 payload as BODY&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" color="#000080"&gt;STEP 2: Decoder from palette&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" color="#000080"&gt;STEP 3: Groovy for building input body&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" color="#000080"&gt;STEP 4: HTTP PUT call&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.Base64;

  def Message processData(Message message) { 
    def body = message.getBody(String);
    body = body.replaceAll("\n", "\r\n");
    
    def multipartBody = """------cpi\r\nContent-Disposition: form-data; name="file"; filename="DOC_T_V6.pdf"\r\nContent-Type: application/pdf\r\nContent-Transfer-Encoding: Binary\r\n\r\n""" + body + """\r\n\r\n------cpi--""";
    message.setBody(multipartBody);
    return message;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample Input :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Unable to attach the Base64 encoded string as the values exceeds. Shared PDF can be converted to Base64 String and can be used as input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 18:11:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13953395#M4894626</guid>
      <dc:creator>das_sappo</dc:creator>
      <dc:date>2024-12-02T18:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Facing issue while Decoding Base64 Encoded PDF in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13989198#M4899612</link>
      <description>hi &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/759772"&gt;@das_sappo&lt;/a&gt; we are facing same issue , were you able to solve it? Our input file is in BIN format when we place it in SharePoint it comes as blank. we try to bas64 encode it and decode it throws error.</description>
      <pubDate>Fri, 17 Jan 2025 14:31:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/facing-issue-while-decoding-base64-encoded-pdf-in-cpi/qaa-p/13989198#M4899612</guid>
      <dc:creator>Ayushi_Dhar1</dc:creator>
      <dc:date>2025-01-17T14:31:40Z</dc:date>
    </item>
  </channel>
</rss>

