https://bugs.documentfoundation.org/show_bug.cgi?id=163748

--- Comment #3 from Mike Kaganski <[email protected]> ---
For the reference: the following Basic code (modelled after yours, with the
important difference of constructing the image using URL, not byte stream)
works fine for me (the file path is, of course, local to my system):

 const MY_PAGE_STYLE_NAME = "MasterPage0"
 doc = StarDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0,
array())
 xPageStyle = doc.createInstance("com.sun.star.style.PageStyle")
 xFamilies = doc.getStyleFamilies()
 xFamily = xFamilies.getByName("PageStyles")
 if (xFamily.hasByName(MY_PAGE_STYLE_NAME) = false) then
  xFamily.insertByName(MY_PAGE_STYLE_NAME, xPageStyle)
 endif

 mText = doc.getText()
 mTextCursor = mText.createTextCursor()
 mTextCursor.setPropertyValue("PageDescName", MY_PAGE_STYLE_NAME)

 xPageStyle.setPropertyValue("Width", 21000)
 xPageStyle.setPropertyValue("Height", 29700)
 xPageStyle.setPropertyValue("LeftMargin", 3000)
 xPageStyle.setPropertyValue("RightMargin", 3000)
 xPageStyle.setPropertyValue("TopMargin", 2000)
 xPageStyle.setPropertyValue("HeaderIsOn", true)
 xPageStyle.setPropertyValue("HeaderHeight", 1500)
 xPageStyle.setPropertyValue("HeaderBodyDistance", 0)
 xPageStyle.setPropertyValue("BottomMargin", 1500)
 xPageStyle.setPropertyValue("FooterIsOn", true)
 xPageStyle.setPropertyValue("FooterHeight", 1500)
 xPageStyle.setPropertyValue("FooterBodyDistance", 0)
 xPageStyle.setPropertyValue("HeaderBackColor", &he8f2a1)
 xPageStyle.setPropertyValue("FooterBackColor", &hffdbb6)

 xGraphicProvider = CreateUnoService("com.sun.star.graphic.GraphicProvider")
 Dim v(0) as new com.sun.star.beans.PropertyValue
 v(0).Name = "URL"
 v(0).Value = ConvertToURL("C:\D\Downloads\BackImage.png")
 graphic = xGraphicProvider.queryGraphic(v)

 xPageStyle.setPropertyValue("BackGraphic", graphic)

 xPageStyle.setPropertyValue("BackTransparent", false)
 xPageStyle.setPropertyValue("BackGraphicLocation",
com.sun.star.style.GraphicLocation.AREA)
 xPageStyle.setPropertyValue("BackgroundFullSize", false)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to