To append an image to your document, you have to use the following methods:
$document->addPicture($path); ODF_Draw::createImage($path, $attributes); ODF_Draw::createFrame($child, $attributes); ODF_Text::createParagraph($child, $attributes);
Before you can add the image to your document, you have to insert it into the archive.
$document = new ODF(); $document->open() or $document->create(); $path = $document->addPicture("path/to/picture");
Now you can add it into your document tree.
$image = ODF_Draw::createImage($path); $frame =ODF_Draw::createFrame($image); $p = ODF_Text::createParagrah($frame);
The paragraph can now be added to your content-body.
There was an error while loading. Please reload this page.