I decided to write a class to manage office documents with PHP.
Word:
function write_word() {
$word = new COM(”word.application”);
$word->Visible = 0;
$word->Documents->Add();
$word->Selection->PageSetup->LeftMargin = ‘2″‘;
$word->Selection->PageSetup->RightMargin = ‘2″‘;
//Setup the font
$word->Selection->Font->Name = ‘Verdana’;
$word->Selection->Font->Size = 8;
//Write some text
$word->Selection->TypeText(”This is a test document”);
//Insert an image
$word->Selection->InlineShapes->addPicture(”C:\\temp\\test.png”);
//Save the document [...]
continue reading.....