Skip to content
Philipp Hirsch edited this page Feb 9, 2014 · 2 revisions

Simple images

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.

Attributes

Clone this wiki locally