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

HTML Content as PDF Attachment

Former Member
0 Likes
2,801

Hi All,

I have HTML Content in an internal table of type SOLI_TAB which is actually the body of the mail.

I need to send the same content as an PDF attachment.

I have written the below code for adding the attachment.

CALL METHOD lp_document->add_attachment       lp_document -> Refrence variable of the type cl_document_bcs
        EXPORTING
          i_attachment_type     = 'PDF'
          i_attachment_subject = iv_msg_subj
          i_attachment_size      = lv_size      lv_size -> Total number of lines in lt_text * 255
          i_att_content_text      = lt_text.      lt_text-> Internal Table with html content

I tried multiple things like converting into XSTRING and various other methods. But no breakthrough.

Just want to understand can we send the HTML content as PDF Attachment.

Anypointers will be helpful.

Thanks in advance.

Regards,

Vinay Mutt

Hi All,

I have HTML Content in an internal table of type SOLI_TAB which is actually the body of the mail.

I need to send the same content as an PDF attachment.

I have written the below code for adding the attachment.

CALL METHOD lp_document->add_attachment       lp_document -> Refrence variable of the type cl_document_bcs
        EXPORTING
          i_attachment_type     = 'PDF'
          i_attachment_subject = iv_msg_subj
          i_attachment_size      = lv_size      lv_size -> Total number of lines in lt_text * 255
          i_att_content_text      = lt_text.      lt_text-> Internal Table with html content

I tried multiple things like converting into XSTRING and various other methods. But no breakthrough.

Just want to understand can we send the HTML content as PDF Attachment.

Anypointers will be helpful.

Thanks in advance.

Regards,

Vinay Mutt

5 REPLIES 5
Read only

Former Member
0 Likes
1,314

Hello Vinay,

Hope this Wiki link helps you in converting  the Internal Table to PDF attachment.

Convert Spool request to PDF and send as e-mail - Code Gallery - SCN Wiki

Hope you find this helpful.

Best Regards,

Jagraj Singh

Read only

prad_k
Explorer
0 Likes
1,314

Please go through this link.

Read only

Former Member
0 Likes
1,314

Hi,

you need to search for a html to pdf routine.

try this Post.

Convert HTML TO PDF

regards

Stefan Seeburger

Read only

Former Member
0 Likes
1,314

Hi All,

Thanks for your replies.

But all the links provided mentions the idea of SPOOL generation and Sending the mail.

As i specified in the post, i want to send the body of the mail content as attachment in the same mail.

Any ideas for using the method specified in the post. Is it possible to achive through that method.

Because, now the pdf attachment is appearing but it is not having valid content so it is not possible to open the attachment.

Thanks and Regardsm,

Vinay Mutt

Read only

Former Member
0 Likes
1,314

Hello Vinay,

I am not sure wheather it is possible to send the email body of same email in PDF as atatchment, but you can do 1 thing.

Create a smartform print your email body content in the smartform then call your smartform before email send functionality and collect the smart form data as PDF (OTF to PDF ).

You should be able to send this as a PDF attachment, and the content  of the PDF will be smartform output.

Regards,

Satyam