Skip to Content

Pdf attached to mail is corrupted !

Hi,

I have a problem with pdf document sent as attachment in a mail.

  • I call a adobe forms,
  • SCMS_XSTRING_TO_BINARY is called to convert it binary.
  • With using cl_bcs class I add this attachment, and mail sent.
  • When sost is executed and pdf clicked I got this error :Adobe Reader could not open file.pdf because it is either not a supported file type or because the file has been damaged.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 27 at 06:55 PM

    Instead of SCMS_XTRING_TO_BINARY I would try

    CL_CO_XMLTOOL=>CONV_XML_TO_PDF


    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      I am using SCMS_XTRING_TO_BINARY to attach it in a mail, do you have sample code for "CL_CO_XMLTOOL=>CONV_XML_TO_PDF" attaching into mail?

      Thank you.

  • Jan 29 at 04:19 PM

    Have you checked what the binary string for your PDF looks like? It could be that trailing nulls have been added which might be what is corrupting your file.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 29 at 05:02 PM

    When adding attachment using CL_BCS class, Are you passing size of the document ?..

    Add comment
    10|10000 characters needed characters exceeded