Skip to Content

Convert or Print an Office Document (Word/XLS) to PDF

Hi Gurus,

I am looking for a solution to convert an existing word or excel document located in presentation server to PDF. Is there a standard way of achieving this in SAP ABAP? I could not find any FMs to achieve this. Tried to do it with OLE technique by Opening the word ->File->print and choosing the ADOBE printer as the printer. But still the doc is not getting generated/converted in PDF. Does anyone know what is the OLE command to set the printer name as the adobe printer. Please share if you know this. It is pretty urgent.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2012 at 10:12 AM

    Why do you need SAP to convert documents from word to PDF?

    You can use any online tools to do that.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Anand Saha

      Oh. So, you want PDF and word document, both.

      Whenever I come across such requirement, I generally convince client to get a PDF output and convert from PDF to word. Because PDF, you can easily get from smartforms and from spool.

      I don't think there is any way to create a word or excel document directly from a smartform. And generating a document from OLE is a difficult task.

      In my opinion, I think I would have generated two documents separately one with OLE and one with smartform. But maintaining both to be exactly same is a difficult task.

      I would be glad to know if you find any other method.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 13, 2012 at 04:46 PM

    In my experience with this, I had to convert a variety of file types to PDF prior to storing in Documentum. For that, we had a web service that was called from within the ABAP program...I passed an xstring, got back an xstring containing hte PDF from that web service, and then proceeded to put the xstring back into binary table, etc. This works, but Microsoft Office documents convert slowly (in my experience), while non-Office files, such as .jpg, gif, etc., converty very quickly. And, one must remember to supply the exact length on the uploaded files (particularly the docx, xlsx, etc.) which is easily obtained with the GUI Frontend Services method, so that the file conversion can handle these correctly. I have posted about this previously under the userid BREAK POINT (prior employer account).

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.