Forum OpenACS Q&A: Re: server side document to .pdf conversion

Collapse
Posted by Radamanthus Batnag on
I ran into a similar problem - converting M$ Word .doc files to text, and the OpenOffice solution seems to have matured a lot since the start of this thread.

Here's a Java example program for batch conversion of text files from any supported OpenOffice format to any other supported OpenOffice format:

http://api.openoffice.org/source/browse/api/odk/examples/java/DocumentConverter/Attic/

Collapse
Posted by zet ucu on
How to do it with Java:

---------------------------------------------------
import officetools.OfficeFile;
...
FileInputStream fis = new FileInputStream(new File("test.doc")); // works with xls also
FileOutputStream fos = new FileOutputStream(new File("test.pdf"));
OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
f.convert(fos,"pdf");
---------------------------------------------------

All possible convertions:
doc --> pdf, html, txt, rtf
xls --> pdf, html, csv
ppt --> pdf, swf
html --> pdf

Maybe useful: http://dancrintea.ro/html-to-pdf/
HTML to PDF with PHP, Java or ASP