Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 2136

Get PDF from base64Binary

$
0
0

Hi all,

 

I am trying to implement a webservice. I receive an answer (XML) with a PDF encoded in a tag the tag starts with <getVerzendlijstResult xsi:type="xsd:base64Binary">.

 

But now the problem.... how can I extract the PDF from here.

 

I tried a lot of possibilities and searched on the forum here, but can not find an answer... Every PDF document I download is not readable.

 

DATA out TYPE xstring.

     DATA lt_bintab TYPE TABLE OF x255.

     DATA: str3 TYPE string,

                str4 TYPE string.


CALL METHOD cl_http_utility=>if_http_utility~decode_base64

       EXPORTING

         encoded = str3 " RAWSTRING from webservice

       RECEIVING

         decoded = str4.

 

     CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

       EXPORTING

         text     = str4

         mimetype = 'APPLICATION/PDF'

       IMPORTING

         buffer   = out.

 

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

   EXPORTING

     buffer                = out

*   APPEND_TO_TABLE       = ' '

* IMPORTING

*   OUTPUT_LENGTH         =

   tables

     binary_tab            = lt_bintab.

 

     CALL FUNCTION 'GUI_DOWNLOAD'

       EXPORTING

         filename = '<path>\Desktop\file.pdf'

         filetype = 'BIN'

       TABLES

         data_tab = lt_bintab.


Can anybody help me??


Viewing all articles
Browse latest Browse all 2136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>