1

Hi everybody I'm using CKeditor to edit and generate some reports for my php project. But I need to export the edited texts from CkEditor to Open office and Microsoft word format. So what I need is a class or component which has a function like these :converttoodf($htmlcode) converttodoc($htmlcodes) which return odf and doc format.

However, The doc and Odf file should be without problem , and the pictures and tables should be shown nicely. In addition, No matter if yr solution be commercial, I may buy it cause I really need it urgently

Tnx in advance and hope can get the right answer asap , here

Nil Null
  • 414
  • 5
  • 14

3 Answers3

0

You might want to take a look at phpword... i know it supports html documents but im not sure if you can jsut load some source and save it out - you may have to build the document programatically.

prodigitalson
  • 60,050
  • 10
  • 100
  • 114
0

If you need ODT anyway, then I'd recommend using OpenOffice via commandline. There is http://www.artofsolving.com/opensource/pyodconverter which can convert between pretty much all Office formats.

HTML import shouldn't be a problem. Don't be foiled by the PDF example. Input and output formats can vary. http://www.oooninja.com/2008/02/batch-command-line-file-conversion-with.html

mario
  • 144,265
  • 20
  • 237
  • 291
  • is it possible to use pyodconverter in PHP? would u provide example? – Nil Null Jun 07 '11 at 03:47
  • It's a commandline script, so `exec("...");` would be how you use it from within PHP. Don't have it installed for testing. – mario Jun 07 '11 at 04:06
0

XLS:
http://docraptor.com/ (automatic conversion from HTML)
or
http://phpexcel.codeplex.com/ (manual building of file, just like phpword from another answer)

DOC
You can get away with just saving the HTML with inline css styles applied and saving it as a .doc. Not sure about how to display images there though.

ODT
http://incubator.apache.org/zetacomponents/documentation/trunk/Document/tutorial.html
more info: http://www.slideshare.net/tobyS/presentation-5028656

Daniel Bang
  • 715
  • 6
  • 21
  • thanks I tried all but each of them has its own problem :( at the end I came up with my own code to convert all stuffs to standard format, for pics and so on I flush-out a zip file containing all files :) – Nil Null Jun 11 '12 at 02:25