Bug 33395

Summary: BackGraphic embeding
Product: LibreOffice Reporter: bugzilla33
Component: BASICAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal    
Priority: medium    
Version: 3.3.0 RC4   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description bugzilla33 2011-01-23 23:18:25 UTC
service: com.sun.star.style.PageProperties

please add new Properties:

1. BackGraphic (type: com.sun.star.graphic.XGraphic)
2. HeaderBackGraphic (type: com.sun.star.graphic.XGraphic)
3. FooterBackGraphic (type: com.sun.star.graphic.XGraphic)

It should be possible to embed a background with 
com.sun.star.graphic.GraphicProvider using queryGraphic method.
Currently there is no way to embed the image background.
Only links (BackGraphicURL, HeaderBackGraphicURL, FooterBackGraphicURL) by 
which the backgrounds are not saved in a odt files.

Please refer to the Graphic property from
http://api.openoffice.org/docs/common/ref/com/sun/star/text/TextGraphicObject.html
Comment 1 Noel Power 2011-01-24 05:20:58 UTC
first this isn't at all a bug, it is at most an enhancement request. But... in this case there is actually no need for an enhancement, there is already a framework in place for handling embedded graphics with the existing api. E.g. if you set the page background to an image ( and don't set it to be a link ) you will see the value of the BackGraphicUrl property will be something like..

vnd.sun.star.GraphicObject:1000000000000800000006008E87321C

you need to look into the http://api.openoffice.org/docs/common/ref/com/sun/star/graphic/GraphicObject.html and http://api.openoffice.org/docs/common/ref/com/sun/star/graphic/XGraphicObject.html. Using the Graphic object service will allow you to create an XGraphicObject that is associated with a 'vnd.sun.star.GraphicObject' scheme URL. Setting the BackGraphicURL, HeaderBackGraphicURL, FooterBackGraphicURL with such and embedded graphic url should do what you require ( if I understood correctly ) Closing the bug ( assuming that using embedded graphics is your intention )
Comment 2 bugzilla33 2011-01-24 06:37:45 UTC
Thanks for the detailed solution. It works.