05-17-2012 11:06 AM
Hi ABAP Gurus --
The overview of the technical requirement:
Note:
Problem:
Bad image resolution from the 256-color bitmap on the forms.
Findings from prior research work:
Question:
How to convert a JPEG binary data/rawstring (or BMP 24-bit) into an 8-bit BMP data in ABAP?
05-17-2012 9:15 PM
I don't see anything in SAP that does this. However, that's not to say that it cannot be done. For instance, I have a program that reads in a binary file, like .xlsx or .mp3, and calls a web service, via proxy, with a method to convert xstring (created from my binary table upload) to a PDF, returning an xstring that I put back into a binary table (type table of tbl1024).
Perhaps that's an alternative that you could explore, if you have software accessible somewhere on the servers available by connection that will do the conversion. I think that there should be software which you can get for server that will do the conversion for you, and give you the converted xstring or binary table back.
05-17-2012 9:15 PM
I don't see anything in SAP that does this. However, that's not to say that it cannot be done. For instance, I have a program that reads in a binary file, like .xlsx or .mp3, and calls a web service, via proxy, with a method to convert xstring (created from my binary table upload) to a PDF, returning an xstring that I put back into a binary table (type table of tbl1024).
Perhaps that's an alternative that you could explore, if you have software accessible somewhere on the servers available by connection that will do the conversion. I think that there should be software which you can get for server that will do the conversion for you, and give you the converted xstring or binary table back.
05-19-2012 12:43 PM
Thanks for the response, Break Point. However, we are limited at what we can install in the system so we had to find ways around it within SAP.
05-19-2012 12:42 PM
Solved. Thanks to Thomas Jung's article:
http://scn.sap.com/people/thomas.jung/blog/2007/09/05/abap-bitmap-image-processing-class
I reused the transform_grayscale method after converting the JPEG to BMP 24-bit via IGS class. This method will result in an 8-bit BMP. The BMP is then loaded to se78 programmatically and the resulting image resolution is just what we were looking for. It appears just as good on the resulting PDF (from Smartforms).
08-28-2012 3:02 PM
Hello, could you please give me the source code part where you convert the jpeg to bmp?
I need to convert a xml file intro bmp to load it to se78 programmatically.
I managed to convert the xml to binary using SCMS_XSTRING_TO_BINARY FM.
Thnx.
09-21-2012 9:59 AM
Hello Dennis Carpio,
first of all thank you very much for this thread!
Do you mean with "reused" transform_grayscale that you modified this method to get a 8-bit Bitmap in color or your requirement is not to use colored graphics?
Best regards
Manuel Nonnenmacher
09-05-2014 1:54 PM
Hi everybody, I know this post is very old but I need solve this issue too. Someone could publish or send me the source or the algorithm for reuse the grayscale method ?
Thank a lot!!
Jose
09-05-2014 5:19 PM
The code is present in Thomas Jung's blog. See the links at the bottom of blog.
You can install the code using SAPlink Project.