You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@openoffice.apache.org by "K.Misha" <mi...@4k.com.ua> on 2013/09/19 20:33:34 UTC
inserting images in writer
Hello!
Can you send me some examples of using images in writer?
p.s.: *.cxx if you can.
Thanks!
Re: inserting images in writer
Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hi,
On Thu, Sep 19, 2013 at 09:33:34PM +0300, K.Misha wrote:
> Hello!
>
> Can you send me some examples of using images in writer?
An image in Writer is a com.sun.star.text.TextGraphicObject, see
http://www.openoffice.org/api/docs/common/ref/com/sun/star/text/TextGraphicObject.html
http://wiki.openoffice.org/wiki/Documentation/DevGuide/Text/Graphic_Objects
- create a graphic object at the document factory, call createInstance
passing the service name
- you can insert a linked or an embedded graphic, in both cases you need
to know the actual size of the image before setting the graphic object
size. Use the GraphicProvider service to retrieve that information,
then set the size with the "Size" property
- linked images are inserted setting the "GraphicURL" property, embedded
images are inserted setting the "Graphic" property; the graphic object
is a text content, you have to use insertTextContent to insert it.
The red warning box at
http://wiki.openoffice.org/wiki/Documentation/DevGuide/Text/Graphic_Objects
is outdated: Embedding of graphics *is* supported by using the
"Graphic" property instead of "GraphicURL"
- there are many other properties controlling the graphic object, they
are documented in
http://www.openoffice.org/api/docs/common/ref/com/sun/star/text/TextGraphicObject.html
http://www.openoffice.org/api/docs/common/ref/com/sun/star/text/BaseFrameProperties.html
Attached is a variation of http://markmail.org/message/cl356hyng5utkuif
Regards
--
Ariel Constenla-Haile
La Plata, Argentina