Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PDF/XString to Image conversion

Former Member
0 Likes
3,292

Hello experts,

There is a requirement in my project to convert the pdf (getting generated from Smartform) as an image format so that we can send it to any other device too and all indentations can be contained as it is. Any help will be appreciated!!

Thanks,

Garima

8 REPLIES 8
Read only

FredericGirod
Active Contributor
0 Likes
1,906

Hi Garima,

use an external free program named : ImageMagick

Regards

Fred

When I have doing this, I wasn't use image magick but GhostScript 

Message was edited by: Frédéric Girod

Read only

0 Likes
1,906

Hi Fred,

Thanks for replying.

But can you please elaborate on how I can use it for all PDFs which are getting generated in background (SAP RFCs) and should be sent to other devices as an image. How will it communicate with SAP?

Thanks in anticipation!

With Regards,

Garima

Read only

0 Likes
1,906

Hi Garima,

you can call an Unix (it's the same for M$) command from SAP using the function SXPG_COMMAND_EXECUTE and playing with transaction SM69.

Or calling directly kernel function CALL 'SYSTEM' ID 'COMMAND' FIELD ...

You have to install GhostScript on each Application Server. The command line looks like gs -dNOPAUSE -sDEVICE=jpeg -r144 -sOutputFile=p%03d.jpg file.pdf

The %03d will allow you to create several JPEG, one by page. The command will replace this char by a number.

If you are on M$, you have to give the complete location of the gs.exe program, not only "gs"

(or you could create a shell script called by SAP)

Regards

Fred

Read only

0 Likes
1,906

Hi Fred,

Thanks for your help!

Will it convert XString also to image? In case my project allows me to call any external system.

I am still trying to look for something in SAP to convert the pdf/otf/XString into image which can be then sent to any other device.

With Regards,

Garima

Read only

0 Likes
1,906

As I understand Xstring is only a container, not a format. I'm not sure you will find something inside SAP. Maybe with OpenText, but OpenText is very expensive.

regards

Fred

Read only

0 Likes
1,906

When I'm writing a document, I see something maybe that you could be interested : function SAPSCRIPT_CONVERT_BITMAP

If you could use a SapScript instead of a Smartforms ...

regards

Fred

Read only

0 Likes
1,906

Hi Fred,

Thank you so much for your help. I have been in touch with my team to use imageMagick for image conversion.

Once again Thank you!!

Regards,

Garima

Read only

sahirn
Product and Topic Expert
Product and Topic Expert
0 Likes
1,906

Hi Garima,

Please check if the function moduel SCMS_BINARY_TO_XSTRING or any other FM from the function group SCMS_CONV helps.

Regards,

Sahir.