API To convert a file to PDF

I want some API and some doc. So I can convert any file to PDF .
The file can be Doc , exl, ppt ..etc

.

My requirement: I have an EX: - Doc file and I just want to convert it to PDF .. using java. Any suggestion would be helpful ...

+3


source to share


5 answers


Apache poi

API is best to convert any file to pdf



0


source


I would recommend that you take a look at Flying Saucer (formerly xhtmlrenderer), which makes creating PDFs extremely easy from XML and HTML files (it uses iText internally).



HTML / XML can be used as an intermediate format, which makes it quite flexible.

+4


source


+2


source


If you want to generate a PDF document from an XML document, you can try Apache FOP, which follows the XSL-FO standard.

http://xmlgraphics.apache.org/fop/

So the smart process could be: extract data from different document formats using POI, odftoolkit (for OenDocument) or other tools, inject it into an XML container, and then convert it to PDF using FOP.

+1


source


You can use Itext . It is well documented and contains tons of examples.

0


source







All Articles