You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by sanjeevatPOI <sa...@gmail.com> on 2011/06/19 16:26:35 UTC
unable to format the new paragraph added to the word doc..
Hi all,
I am unable to format the new paragraph added to the word doc. I am using
the code as
public void addPara()
{
// centered paragraph with large font size
Range range = doc.getRange();
Paragraph par1 = range.insertAfter(new ParagraphProperties(), 0);
//System.out.println("para1:-"+par1.text()+".");
par1.setSpacingAfter(200);
par1.setJustification((byte) 1);
// justification: 0=left, 1=center, 2=right, 3=left and right
CharacterRun run1 = par1.insertAfter("one");
run1.setFontSize(2 * 18);
run1.setBold(true);
FileOutputStream fos=null;
try
{
File file1=new File("D:/test/writetest.doc");
fos=new FileOutputStream(file1);
doc.write(fos);
}catch(Exception ex)
{
System.out.println("write error: "+ex);
}
}
niegther the code for formatting paragraph nor for character run is working.
Whtas happening? Please help,,,,
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/unable-to-format-the-new-paragraph-added-to-the-word-doc-tp4503590p4503590.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