Quantcast
Channel: SCN : Blog List - ABAP Development
Viewing all articles
Browse latest Browse all 943

The case of cl_http_utility=>decode_x_base64

$
0
0

Hi,

 

Lately there was a thread of converting BASE 64 TO PDF .

 

I was intrigued so I decided to do some tests (We might get any kind of data this way) .

 

Using Java I generated a Base64 text file (this will be used as input ) .

screenshot_01.png

This is how the output file looks like (1,060,588 byte long string)

screenshot_02.png

Time for some abap code:

 

Program steps ( Y_R_EITAN_TEST_31_10 ) :

 

- Using cl_gui_frontend_services=>gui_upload to upload the text file.

- Using cl_http_utility=>if_http_utility~decode_x_base64 to decode the data the output from this method is xstring .

- CALL METHOD cl_gui_frontend_services=>gui_download to write the xstring as PDF .

 

I have new valid PDF file named "An Easy Reference for ALV Grid Control.new.pdf" .

 

Comparing the files using MD5 tell me that the files are not identical !!!!

 

screenshot_03.png

So I used a binary editor to compare:

screenshot_04.png

There is some extra bytes in the new file .

 

This does not interfere in this case but might cause a problem with other file formats and it is annoying...(Any idea ???? )

 

This all for now.

 

regards.


Viewing all articles
Browse latest Browse all 943

Trending Articles



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