7576777879808182838485
{ throw new DocumentReadException("Can't open document.", e); } Range range = doc.getRange(); text = range.text(); } finally { if (is != null) {
8788899091929394959697
7071727374757677787980
{ return ""; } Range range = doc.getRange(); text = range.text(); } finally { if (is != null) try
149150151152153154155156157158159
r = docAscii.getRange(); assertEquals( a_page_1 + page_break + "\r" + a_page_2, r.text() ); r = docAscii.getHeaderStoryRange(); assertEquals( headerDef +
159160161162163164165166167168169
headerDef + a_header + footerDef + a_footer + endHeaderFooter, r.text() ); r = docAscii.getOverallRange(); assertEquals( a_page_1 +
173174175176177178179180181182183
a_header + footerDef + a_footer + endHeaderFooter + "\r", r.text() ); } public void testBasicsUnicode() throws Exception { // First check the start and end bits
220221222223224225226227228229230
r = docUnicode.getRange(); assertEquals( u_page_1 + page_break + "\r" + u_page_2, r.text() ); r = docUnicode.getHeaderStoryRange(); assertEquals( headerDef +
230231232233234235236237238239240
headerDef + u_header + footerDef + u_footer + endHeaderFooter, r.text() ); r = docUnicode.getOverallRange(); assertEquals( u_page_1 +
244245246247248249250251252
u_header + footerDef + u_footer + endHeaderFooter + "\r", r.text() ); } }
611612613614615616617618619620621
try { HWPFDocument doc = new HWPFDocument(new FileInputStream(args[0])); Range r = doc.getRange(); String str = r.text(); int x = 0; // CharacterRun run = new CharacterRun(); // run.setBold(true); // run.setItalic(true); // run.setCapitalized(true);