使用Adobe lifecycle Enterprise Service將word文件轉換成PDF
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).
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.
(2) You can find detail installation steps from :
For normal usage just choose “Turnkey”.
The installation took about twenty minutes in my laptop with 4G memory, Inter(R) Core(TM) i5 CPU 2.53GHz, Win7 64bit OS.
(3) Once installation done, log on with administration console with
. 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.
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.
(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.
The server consumes 1.9G memory in my laptop:
(5) Do some health check on server. Click home->services->LiveCycle PDF Generator ES4:
Click “Create PDF”:
Load any document with type other than PDF to try:
You may meet with following error messages:
(1)
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:
You can also download Acrobat XI Pro trial version from here:
Install and maintain the environment variable:
Also never forget to set the printer ADOBE PDF as default printer:
Then retry PDF creation and you should see the following screen:
And you can also see successful information in server.log:
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.
(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:
(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.
You can find your own data type via SE80, expand Data Types:
Find the type ends up with BLOB, that’s it.
Replace all “zasmblog” in sample code with it. After that you can activate the code.
(8) Test the application.
The lo_srv is instance of your consumer proxy class.
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.
ICM_HTTP_CONNECTION_FAILED: please firstly check whether your server is available, secondly check whether your RFC destination to server works or not:
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.
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.
If everything runs well you will see final PDF displayed.
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.
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.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2708653/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- pdf轉換成word文件
- win10 pdf怎麼轉換成word_win10如何把pdf轉換成word文件Win10
- stirlingpdf PDF 工具將PDF轉換成Word
- 利用vbs指令碼將word文件轉換為pdf指令碼
- 將Reporting Service報表轉換成.doc或pdf文件格式
- pdf轉換成word,免費轉換
- 如何將檔案PDF格式轉換成Word格式
- Java 將Markdown檔案轉換為Word和PDF文件Java
- 蘋果手機如何將PDF檔案轉換為Word文件蘋果
- 將PPT文件轉換為Word文件
- PDF文件轉換器PDF to Word Document Converter MacMac
- pdf轉換成word,非常實用
- 職場辦公分享:word文件轉換成pdf更方便傳輸
- 有哪些免費的方法可以將PDF轉換成Word?
- 利用 Adobe Reader 的API將 PDF 轉換成 BMPAPI
- pdf的表格怎麼轉換成word?
- Word文件批次轉換成TXT文字
- go用unioffice轉換word文件為pdfGo
- Python 將Word/ Exce/ PDF/ PPT文件轉為OFD文件Python
- 如何將Word文件轉成Excel表格?Excel
- 如何將Powerpoint文件轉換為Word文件
- C# 將PDF文件轉換為Markdown文件C#
- 手機PDF檔案怎麼轉成word文件
- 如何用Python把pdf轉換成wordPython
- 分享線上pdf轉換成word格式的方法
- ppt轉換word文件怎麼操作 把ppt轉換成word純文字
- Word將文字轉換成表格技巧
- 巧將PowerPoint文字轉換Word文件
- 將“PDF轉換成PPT”與“PPT轉PDF”的方法
- excel表格怎麼轉換成word文件 表格資料轉換到文件Excel
- pdf怎麼轉換成word免費軟體 電腦上pdf免費轉成word方法有哪些
- aspose word轉換pdf檔案後將pdf檔案轉換為圖片png
- PDF轉Word?PDF轉換工具推薦:PDF to Word Document Converter for MacMac
- pdf轉word如何線上轉換?
- 輕鬆將Word文件快速轉成Flash檔案(轉)
- PDF to Word Document Converter Mac(PDF轉Word檔案轉換器)Mac
- 使用Aspose.Words元件進行word文件書籤替換,文件、圖表插入,轉pdf等元件
- PowerPoint如何將簡報轉換為WORD文件