You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Mathieu Grosmaire <ma...@gmail.com> on 2008/06/04 14:44:28 UTC

HSLF font name problem on TextBox updating

Hello

I want to update a TextBox with several RichTextRun and only the first
respect the font name.
And another problem occurs on OpenOffice2.4, the last RichTextRun is
duplicated according to the number of RichTextRun.

Sample code :
        // the template contains only one textbox with one RichTextRun
	SlideShow ppt = new SlideShow(new HSLFSlideShow("template/test2.ppt"));
		
	Slide s = ppt.getSlides()[0];
	TextBox tb = (TextBox)s.getShapes()[0];
			

tb.getTextRun().changeTextInRichTextRun(tb.getTextRun().getRichTextRuns()[0],"test");
		
	RichTextRun rtr = tb.getTextRun().getRichTextRuns()[0];
	rtr.setFontName("Times New Roman");
	rtr.setFontSize(12);
	rtr.setBold(true);
	rtr.setItalic(true);	
			
	rtr = tb.getTextRun().appendText(" test1");
	rtr.setFontName("Calibri");
	rtr.setFontSize(14);
	rtr.setBold(true);
	rtr.setItalic(true);
			
	rtr = tb.getTextRun().appendText(" test2");
	rtr.setFontName("Calibri");
	rtr.setFontSize(15);
	rtr.setBold(true);
	rtr.setItalic(true);
	
	FileOutputStream out = new FileOutputStream("report/slideshow.ppt");
	ppt.write(out);
	out.close();

Regards
MG
-- 
View this message in context: http://www.nabble.com/HSLF-font-name-problem-on-TextBox-updating-tp17645864p17645864.html
Sent from the POI - User mailing list archive at Nabble.com.


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