You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Jeff Lavezzo <JE...@saic.com> on 2010/03/08 18:12:44 UTC

Re: Apache POI - HSLF - RichTextRun color not setting

Just to clarify, All the text in the entire slide show is black. If
there's an overkill way of setting text color, I'll take that.  And here
are the specific messages returned by the debug:
DEBUG A current text run's color is java.awt.Color[r=255,g=255,b=255]
DEBUG B current text run's color is java.awt.Color[r=0,g=0,b=0]

Thanks,

Jeff

> I'm currently trying to merge the contents of one powerpoint file into
> another using the HSLF libraries.  Everything is working fine, except the
> text is coming into the new file white.
>
> Here's a snip of the Groovy code I've written:
> if (incomingShape instanceof TextBox){
>     TextBox inTextBox = incomingShape
>     inTextBox.setSheet(targetSlide)
>     inTextBox.getTextRun().supplySlideShow(TargetPPT)
>     inTextBox.getTextRun().setSheet(targetSlide)
>     inTextBox.getTextRun().getRichTextRuns().each {theRTR->
>         println "DEBUG A current text run's color is
> ${theRTR.getFontColor()}"
>         theRTR.setFontColor(Color.BLACK)
>         println "DEBUG B current text run's color is
> ${theRTR.getFontColor()}"
>     }
>     heightAdjustShape(inTextBox)//local method to help layout
>     targetSlide.addShape(inTextBox)
> }
> Before setting the sheet, DEBUG A was reporting the color as black, now it
> reports as white. DEBUG B always reports as black. And, regardless, when
> opening up the resulting ppt, the text is white.
>
> Any ideas?
>
> Thanks,
>
> Jeff

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org