# Convert DOC and XLS to PDF

**URL:** <https://forum.kirupa.com/t/convert-doc-and-xls-to-pdf/283281>\
**Category:** programming\
**Created:** [March 4, 2009, 1:31pm UTC](https://forum.kirupa.com/t/convert-doc-and-xls-to-pdf/283281 "2009-03-04T13:31:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![corr](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@corr](https://forum.kirupa.com/u/corr)\
**Post date:** [March 4, 2009, 1:31pm UTC](https://forum.kirupa.com/t/convert-doc-and-xls-to-pdf/283281/1 "2009-03-04T13:31:59Z")

</div>

My team came across a new solution which allow conversion of ms office formats, especially doc and xls to pdf. Solution is provided by this guy on this page: [DOC to PDF with Java](http://dancrintea.ro/doc-to-pdf/)

How it works:

```
**[COLOR=#eb2e32]Java Code[/COLOR]**
import officetools.OfficeFile; // from officetools.jar

```

FileInputStream fis = new FileInputStream(new File(“test.doc”));  
FileOutputStream fos = new FileOutputStream(new File(“test.pdf”));

OfficeFile f = new OfficeFile(fis,“localhost”,“8100”, false);

f.convert(fos,“pdf”);

Are you using a similar solution in Java or PHP?

I am currently trying to find more solutions and to compare them for quality and speed.

Thanks.
