poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathieu Grosmaire <mathieu.grosma...@gmail.com>
Subject HSLF font name problem on TextBox updating
Date Wed, 04 Jun 2008 12:44:28 GMT

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


Mime
View raw message