使用相同的API编写Word和PDF文档 [英] Using the same API to write both Word and PDF documents

查看:109
本文介绍了使用相同的API编写Word和PDF文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

在Apache POI /

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 ?

推荐答案

我不知道您提到的两个库的统一API.

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

但是,使用单个API可能仍然有一些选择:

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.

这篇关于使用相同的API编写Word和PDF文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆