I can prepare a single line of text for the Aspose Words (for Java) to write to a Document; for example:
private static final String titleText = "[FSCO-MOE3.1] Objective 50XX under the Phase II";
where FSCO-MOE3.1 is an ID.
What I really would like to do is as follows (writing each segment of that line one at a time):
First, write several spaces;
Second, write the ID; for example, ‘FSCO-MOE3.1’, enclosed in a pair of square bracket;
Third, write a space
Fourth, write in bold the text; for example, ‘Objective 50XX under the Phase II’.
How do I do something like what described above? Is it possible to be done? I can use a Java Array to store the information. For example, the first element of the String Array is the ID and the second element of the String Array is the text. How do I modify the code shown below to accomplish writing those segments one at a time?
Thank you for your help.
Paragraph hierarchyLevelParagraph = new Paragraph( wordMeasurementSummaryReport ); wordMeasurementSummaryReportBody.appendChild( hierarchyLevelParagraph ); hierarchyLevelParagraph.getParagraphFormat().setStyleName("Heading 2"); hierarchyLevelParagraph.getParagraphFormat().setAlignment(ParagraphAlignment.LEFT); Run hierarchyLevelParagraphRun = new Run( wordMeasurementSummaryReport ); hierarchyLevelParagraphRun.setText( titleText ); hierarchyLevelParagraphRun.getFont().setName( "Arial" ); hierarchyLevelParagraphRun.getFont().setSize( 10 ); hierarchyLevelParagraphRun.getFont().setColor( Color.BLUE); hierarchyLevelParagraph.appendChild( hierarchyLevelParagraphRun );