开发者

Using the same API to write both Word and PDF documents

开发者 https://www.devze.com 2022-12-28 05:24 出处:网络
HI all is there any kind of开发者_开发技巧 abstraction API over Apache POI/FOP allowing one to use the same API to write both Word and PDF documents ?I\'m not aware of a unified API for the two libra

HI all

is there any kind of开发者_开发技巧 abstraction API over Apache POI/FOP allowing one to use the same API to write both Word and PDF documents ?


I'm not aware of a unified API for the two libraries you have mentioned.

However you may still have a couple of options using a single API:

  • Use Apache POI to generate the documents in Word format and then use a Word to PDF conversion library to create a PDF from the word document. Another commenter has suggested IText
  • Use OpenOffice via its Java API to create documents and export them in Microsoft Word or PDF format.


Docmosis will do what you require, assuming you mean a Java (or command line) API. It reads doc and odt files as templates, populates/manipulates via the Java API, and produces the output formats OpenOffice supports. Have a look at the online demo on the web site which lets you see various output formats to render a document in.


When I was working on previous project, I was sure the Apache/POI can be used for Microsoft Documents.

we have IText.jar which we can use it for PDF generation and alteration. please check this will help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消