10

My company is looking into exporting data from our web application into familiar, usable formats for end users. We're evaluating producing ODT (OpenOffice.Org Writer) files and I'm looking for a library to generate them.

Our application is largely written in PHP but we also use a fair amount of Python and I'm open to making the case to use whatever language is best; it's much more important to us that we are able to produce polished files reliably and with a good degree of control of formatting.

Our main requirements are that it has the power to generate polished looking files (unlike most HTML-to-whatever-style converters), and that the files are subsequently easily editable by end users (we already provide PDFs, but some clients are requesting formats they can modify because their needs for final documentation differ).

The documents will be largely text and images, in a tabular format (essentially, questions and answers), so we will likely need support for tables.

  • It would help if you could give some examples of what these files contain. Just text? Images? Graphs? Stuff like that. – Seth Aug 1 '14 at 15:18
  • Seth, thanks for the advice. I've updated my question. Specifically, it's tabular output featuring text and images. – Damon Aug 1 '14 at 15:39
5

I would suggest the PHPOffice Project - specifically PHPWord. It is opensource and free. Despite the name PHPWord it supports a lot of formats - .doc, .ods, .rtf, .html and .pdf.

There are currently only 12 open bugs - and none of them are older than May (2014). It has fairly detailed documentation and is under active development.

1

You may want to try this OpenOffice document generation PHP class. It can take existing OpenOffice XML documents as templates and generate your final document the way you need.

1

JODReports (open source) and Docmosis (commercial) are built using the Open Office / Libre Office API, so ODT format is native to these application. The output is going to be as polished as your input. If you are dealing with ODT format, then the conversion to PDF output is also very good.

Both libraries are intended for adding to applications and can be driven from PHP programs. Please not I work for Docmosis.

I hope that helps.

0

You should try OpenTBS.

It's an open source PHP library which builds OpenOffice and Ms Office documents with the technique of templates.

No temp directory, no extra exe needed. First create your ODT (also ODS, ODP, DOCX, SLSX, PPTX), then you use OpenTBS to load the template and change the content using the Template Engine. At the end, you save the result where you need. It can be a new file, a download flow, a PHP binary string.

OpenTBS can also change pictures and charts in a document, merge tables, and others.

Demo page, Documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.