This would be an example of a document generated with this library: Example1

This example would be generated with the next code:

$d = new oxml_wordml("example1");


$t = new oxml_toc();

$ppt1 = new oxml_propParagraph();
$d->addParagraph(new oxml_Paragraph($ppt1,"First Title"));

$p = new oxml_Paragraph();
$p->addText("This is the text of the paragraph");

$p = new oxml_Paragraph($ppt1);
$p->addText("Second Title");

$pt = new oxml_propText();

$p = new oxml_Paragraph();
$p->addText("Now we change the font ");
$p->addText("OF THIS TEXT ", $pt);
$p->addText(" until here.");

$p = new oxml_Paragraph($ppt2);
$p->addText("First Subtitle");

$pp = new oxml_propParagraph();

$p = new oxml_Paragraph($pp);
$p->addText("If my poor Flatland friend retained the vigour of mind which he enjoyed when he began to compose these Memoirs, I should not now need to represent him in this preface, in which he desires, firstly, to return his thanks to his readers and critics in Spaceland, whose appreciation has, with unexpected celerity, required a second edition of his work; secondly, to apologize for certain errors and misprints");

$pt = new oxml_propTable();
$pt->width = 100;

$pp = new oxml_propParagraph();

$t = new oxml_table();
$t->addElement(0,0,new oxml_Paragraph($pp,"Elem1"));
$t->addElement(0,1,new oxml_Paragraph($pp,"Elem2"));
$pr = new oxml_propTableRow();
$t->addElement(1,0,new oxml_Paragraph(NULL,"Elem3"));
$t->addElement(1,1,new oxml_Paragraph(NULL,"Elem4"));
$pc = new oxml_propTableCell();
$pc->width = 20;
$pc->fill = "C3D69B";
$t->addElement(2,0,new oxml_Paragraph(NULL,"Elem5"),$pc);
$t->addElement(2,1,new oxml_Paragraph(NULL,"Elem6"));

$p = new oxml_picture();
$p->file = '/tmp/book.jpg';
$p->filename = "book.jpeg";

$d->addParagraph(new oxml_Paragraph());
$d->addParagraph(new oxml_Paragraph());

$d->addParagraph(new oxml_Paragraph(NULL,"New paragraph"));