Skip to Content

Currently I am working on a customer project regarding the usage of SAP document builder. Document builder is an ABAP webdynpro application which could allow you to main template part with various document type ( html, txt, pdf, docx etc ) into a final document with again various document type. You can find more information of it via SCN wiki here.

You can play with it by starting WebDynpro application /IPRO/WD_DOCB. In preview tab there are several output types. 1 means the default docx format and 11 means PDF format ( via LiveCycle ES).

/wp-content/uploads/2013/11/clipboard1_323386.png

By default only docx output is supported by SAP, the PDF output is just provided via consulting note “1154999 – Using Adobe/LiveCycle ES to Render Docb Document to PDF“. As the PDF output is fundamental for customer, I have to make it work. Unfortunately the consulting note itself just contains the common development steps like how to create ABAP consumer proxy class, how to maintain logical point and RFC destination, but not for Adobe Livecycle Server configuration and deployment etc. If you are interested with this topic, please continue to read.

Although this blog is talking about document builder but actually the idea could be used generically in other case: as long as you have a binary content of a word document, you can consume Adobe LC ES to convert it to PDF in your application.

You might ask that you can google “PDF conversion” and there are plenty of open source solutions and free web services to do the job. However, the customer I am working for is the Top one in its area in China with government background. Take security into consideration, can you imagine they can accept their highly confidential document is sent to a public server which is not deployed within their landscape? You can also googled many undocumented command usage regarding Acrobat Pro which can silently do several operations like print without UI. I didn’t try that since the undocumented means if I have any issues, I could not get any official support from Adobe.

1. Of course the Adobe Livecyle ES is not for free. You must buy license from Adobe. This blog is written based on a trial version called “JBoss (window version)”, which you can download freely from Adobe website below.

/wp-content/uploads/2013/11/1_323462.png

/wp-content/uploads/2013/11/2_323463.png

2. You can find detail installation steps from http://helpx.adobe.com/livecycle.html:

/wp-content/uploads/2013/11/3_323464.pngFor normal usage just choose “Turnkey”.

/wp-content/uploads/2013/11/4_323465.png

The installation took about twenty minutes in my laptop with 4G memory, Inter(R) Core(TM) i5 CPU 2.53GHz, Win7 64bit OS.

1.     3. Once installation done, log on with administration console with http://localhost:8080/adminui. The default user/password : administrator/password.

For security reasons please change default password immediately.

If you can see the following screen, it means your installation is successful.

/wp-content/uploads/2013/11/5_323466.png

If you encounter any errors please check the installation logs. The path is:

“C:\Adobe\Adobe LiveCycle ES4\Adobe_LiveCycle_ES4_InstallLog.log” in my laptop.

1.    4. Configure JBoss server as a service in OS. You can find how to do this in document in path “C:\Adobe\Adobe LiveCycle ES4\jboss\bin\README-service.txt”. If you are installing the trial version on your laptop, it is recommended to set the service startup type as “Manual”. Or else every morning when you launch your laptop, you must have a cup of coffee because you can really use it.

/wp-content/uploads/2013/11/6_323467.png

The server consumes 1.9G memory in my laptop:

/wp-content/uploads/2013/11/7_323468.png

1.     5. Do some health check on server. Click home->services->LiveCycle PDF Generator ES4:

Click “Create PDF”:

/wp-content/uploads/2013/11/8_323469.png

Load any document with type other than PDF to try:

/wp-content/uploads/2013/11/9_323470.png

You may meet with following error messages:

1./wp-content/uploads/2013/11/10_323471.png

In fact the JBoss server uses Adobe Acrobat XI Pro to convert the document into PDF format.

The error message prompts you that either Acrobat XI Pro is not installed or there is something wrong with environment variable set up. Don’t mix Acrobat XI Pro with Acrobat Reader XI!
Acrobat has far more powerful functionalities than the latter:

/wp-content/uploads/2013/11/11_323472.png

You can also download Acrobat XI Pro trial version from here:

/wp-content/uploads/2013/11/12_323473.png

Install and maintain the environment variable:

/wp-content/uploads/2013/11/13_323477.png

Also never forget to set the printer ADOBE PDF as default printer:

/wp-content/uploads/2013/11/14_323478.png

Then retry PDF creation and you should see the following screen:

/wp-content/uploads/2013/11/15_323479.png

And you can also see successful information in server.log:

/wp-content/uploads/2013/11/16_323480.png

It is always a good practice to analyze server.log (“C:\Adobe\Adobe LiveCycle ES4\jboss\server\lc_turnkey\log\server.log” ) if you encounter any issues.

1.     6. Import the docb_assmwml.lca attached in the note.

In admin console Home->Services->Applications and Services, ensure the status of docb_assemwml is running:

/wp-content/uploads/2013/11/17_323481.png

1.     7. Create the consumer proxy class in ABAP system as usual. Implement the BAdI by copying the code from note attachment. The code could not be directly activated since the generated data proxy used in the code does not exist in your own system. You must manually replace them with your own data proxy.

/wp-content/uploads/2013/11/18_323482.png

You can find your own data type via SE80, expand Data Types:

/wp-content/uploads/2013/11/19_323483.png

Find the type ends up with BLOB, that’s it.

/wp-content/uploads/2013/11/20_323485.png

Replace all “zasmblog” in sample code with it. After that you can activate the code.

1.     8. Test the application.

The lo_srv is instance of your consumer proxy class.

/wp-content/uploads/2013/11/21_323486.png

The request variable ls_invoke_request contains the binary content of original document in docx format, the response variable contains the converted binary content of PDF format, if successful. In case the conversion fails, you can again check the server.log to find root cause. Alternatively you can also use tcode SRT_UTIL to check.

/wp-content/uploads/2013/11/22_323487.png

ICM_HTTP_CONNECTION_FAILED: please firstly check whether your server is available, secondly check whether your RFC destination to server works or not:

/wp-content/uploads/2013/11/23_323492.png

ICM_HTTP_TIMEOUT: this error occurs occasionally in my testing since I install the server in my laptop and it took the server a huge time to try to convert a complex docx file into PDF format. If you also meet with this error, try to enlarge the time out threshold setting in admin console.

HTTP Code: 500 ( Internal Server Error ): it indicates some exception raised from server side when doing the conversion job.

For example: the below detail explanation gives you a hint that the environment for Acrobat XI pro is not set properly.

/wp-content/uploads/2013/11/24_323493.png

And this error information demonstrates that the requested service “docb_assemwml” could not be found in server side. Either check in server side whether the status of it is running or check the name of service is correct.

/wp-content/uploads/2013/11/25_323496.png

If everything runs well you will see final PDF displayed.

/wp-content/uploads/2013/11/26_323497.png

You can also save the file locally and open it with any PDF reader. If the PDF is converted via trial version of Adobe Livecycle ES, you will see the corresponding water mark on it.

/wp-content/uploads/2013/11/27_323498.png

Summary: if you reach here I really appreciate your reading on this blog. Adobe LC ES has far more powerful functionalities and the feature in this blog is just a tip of iceberg. You can explore more in Adobe website. My team is responsible for Document builder in SAP. If you have any questions regarding it, just feel free to contact me.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply