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

Convert binary to pdf

Former Member
0 Likes
1,688

Hi experts,

We're using a Z function to read the activity's attachment and send it from mail.

the problem occurs when the attachment is of type .DOC, and in the mail the attachment is corrupt.

Now, we would convert the binary of the document from .DOC but as PDF.

for send mail we are using CL_BCS.

CALL METHOD cl_document->get_document

           EXPORTING

             io            = ls_io

           IMPORTING

             properties    = lt_properties

             content_bin   = lt_binary

             content_ascii = lt_ascii.

CALL METHOD document->add_attachment

           EXPORTING

             i_attachment_type    = file_type -> FILE TYPE RETURNED FROM LT_PROPERTIES

             i_attachment_subject = file_des

             i_att_content_hex    = binary_content.

Anybody has any ideas?

Best regards

Marco.

2 REPLIES 2
Read only

ravi_lanjewar
Contributor
0 Likes
670

Hi,

Please check the below link:

http://scn.sap.com/thread/1214908

Read only

Former Member
0 Likes
670

I convert the binary to xstring, then I call a web service that converts the xstring to PDF and returns that back as an xstring.  In my case, I think webservice is part of documentum system, perhaps, but not certain.  At any rate, you need something that will read binary or xstring and do the conversion to portable data format and return xstring or binary table back to you.