Doc file is not been generated in basic example

Jan 24, 2011 at 5:43 AM
Edited Jan 24, 2011 at 5:55 AM

hello friends,

   I have followed the procedure shown in documentation.I still dont know how to get those two extension

    1)zip Archive

     2)xmllib

But i can extrac the zip file...Does it mean the same extension.When i include the basic e.g and run the code.I get the empty page.I am using openoffice and ubuntu operating system

here goes the code

<?php
require_once 'word/PHPWord.php';

/ New Word Document
$PHPWord = new PHPWord();

// New portrait section
$section = $PHPWord->createSection();

// Add table
$table = $section->addTable();

for($r = 1; $r <= 10; $r++) { // Loop through rows
    // Add row
    $table->addRow();
   
    for($c = 1; $c <= 5; $c++) { // Loop through cells
        // Add Cell
        $table->addCell(1750)->addText("Row $r, Cell $c");
    }
}
// Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('BasicTable.docx');
?>

 

Any help

thanks in advance

Jan 25, 2011 at 3:34 PM

It is a bit confusing about the requirements. It would be good to see more documentation about them...and how to tell via your phpinfo page whether you have the requirements or not.

Here is the main page for php_zip
http://www.php.net/manual/en/book.zip.php

And here is the libxml
http://www.php.net/manual/en/book.libxml.php

related discussion
http://phpword.codeplex.com/Thread/View.aspx?ThreadId=228842

You might also read the phpExcel discussion board, as the requirements for phpExcel are the same as for phpWord. Good luck!