[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Questions about POI HWPFDocument
From:       "Zachary Mitchell" <zac.j.m () internode ! on ! net>
Date:       2010-05-22 9:51:22
Message-ID: 25AD6E7FCE774D5B923BDD00431D4B6D () homeone
[Download RAW message or body]


If I am to go:

?

//*********************************************************************

import ...;

int colorOne = 7;

int ftcfe = 9;

HWPFDocument document = new HWPFDocument();

FontTable fontTable = document.getFontTable();

List fontList = Arrays.asList(fontTable.getFontNames()); //This is how to 

wrap a primitive array.

ListIterator fonts = fontList.iterator();

while(fonts.hasNext())

{

System.out.println(next.toString()); //A

}

Range range = document.getOverallRange();

CharacterRun runOne = range.getCharacterRun(0); //B

Range rageOne = new Range(0,3000,document);

CharacterRun runTwo = runOne.insertAfter("This is some initial Text");

runTwo.setBold(true);

runTwo.setColor(colorOne); //C

runTwo.setFontSize(16);

runTwo.setFtcFE(ftcfe); //D

//Create a paragraph:

Paragraph paragraphOne = new Paragraph(0,200,document.getRange()); //E

...

document.write(new FileOutputStream(new File("WordFile1.doc")));

//*********************************************************************

?

-A: if done with an initially empty constructor HWPFDocument, will this 

print

all of the TrueType Font names visible through the JVM from the 

particular OS?

Will the index of a particular font be the int value for use in //D ?

-B: Is this how one creates consecutive new CharacterRuns? Can you create 

your own

CharacterRuns within a Range stipulating a start index?

What happens with how CharacterRuns end?

-C: Should be a simple one; where are the names/indicies for color values 

here?

-D: If there are TTF names and indicies at //A, is this the index data 

needed here at //D ? 

-E: Is this how one creates a paragraph using pure Java inside

the Java HWPFDocument?

-F: In Java, the newline character symbol is '\n'. In Microsoft Word,

one may type [shift+Enter] for a new line without starting

a paragraph, and [Enter] to end,start a paragraph.

How may one do the [shift+Enter} equivalent in an HWPFDocument?

Do I just insert a '\n' or "\n" where wanted?

?

?



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic