on 11-29-2023 5:22 PM
Hi Abapers/experts
Any anyone know how to convert xstream to PNG format?
In ABAP/odata , I have generated QR code, which is in xstream or base64 format in abap/odata. I want that QR code in PNG format.
Anyone any idea,
Also will work, on SAP UI5 side to convert base64 or xstream in PNG format.
Thanks
Radhesh
Hi Radhesh,
when it's only all about a base64 encoding I can recommend the XCO library for this:
https://help.sap.com/docs/btp/sap-business-technology-platform/xstring
Maybe this code snippet might help how to do it:
DATA(base64) = xco_cp=>xstring( xstring
)->as_string( xco_cp_binary=>text_encoding->base64
)->value.
best regards, Ingo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks all, I converted QR code from xtream format to pdf format and that is working for me.
But still, no answer for , i want function module for convert xtream to png format.
but closing thread.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems that you didn't understand what I explained about xstream. Concerning your sentences "convert from xstream to pdf" and "convert from xstream to png", the two are completely different conversions !
The good answer would be better not convert from PDF to PNG, but generate the QR code directly in PNG format.
Thanks @Ingo.Braeuninger
For reply. I think this will not solve the problem. I want to get the output in PNG format and not sure if this piece of code will do that.
Thanks
Radhesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
radheyy
Ingo has given the right answer, but you don't understand it, because you think the PNG format is something special, which is completely wrong. The only problem you have is to decompress into bytes, whatever binary format it corresponds to, JPG, PDF, BMP, PNG, ZIP and so on.
I hope you understand and you will try the solution given by Ingo, provided that you have the sufficient ABAP version (I guess 7.56).
thanks for your reply. what do you think? I didn't try to it convert into a different format in ABAP?
I tried all the ways. byte,base64,xtream,bmp etc
While attaching that into pdf hear is the error "The input is not a PNG file".
I think in abap, there's no method or FM or any method to convert files into PNG format. I tpng-prob.pngried min.js, js, etc in javascript, but no method found to convert it into a perfect PNG format.
Also check https://pdf-lib.js.org/, pdf-lib dot js dot org --> add image(PNG) in pdf(layer).
I'm doing QR Imprint in pdf with the help of pdf-lib in sap ui5.
QR is a dynamic URL, generated in the backend ABAP.
For this, pdf(stream) format, is converted to base64 and then in an array buffer. both work base64/array buffer.
Now I have a pdf in non xtreme format and ready for edit . Now need the QR in PNG format so that I can attach QR in pdf.
So simple question, how to convert xtream/base64 to PNG format?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
my simple question is.
In abap how to convert xtream or base64 to PNG format? If you know the answer please right down hear.
I know about xtream/base64 binary. might be lots of users know.
simple question is there. In abap how to convert xtream or base64 to PNG format?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.