poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markl16 <mwilliam...@tssg.org>
Subject Re: Extract Text with style/type information
Date Fri, 22 Jan 2010 15:49:25 GMT

Yep i think you were on to something there, i tried:
[code]
if(paragraph instanceof ListEntry)
{
	System.out.println("true");
}
else
{
	System.out.println("false");
}
[/code]
Which seemed to work, ill do some more research and see does a similar
solution work for all the tags i want.

Best
Mark


MSB wrote:
> 
> I am hoping that it really is this simple but I cannot be too sure that it
> really will be. The org.apache.poi.hwpf.usermodel.Range class is the
> parent class for CharacterRun, DocumentPosition, Paragraph, Section, Table
> and TableCell, whilst Paragraph is the parent of ListEntry. I have never
> tried this but could it be as simple as using instanceof to test what
> class you actually had in hand whilst parsing the document? It should be
> easy enough to test this hypothesis;
> 
> Open a document.
> Get the top level Range object.
> Get the number of Pargraphs.
> Iterate through the Paragraphs one at a time and test to see what object
> you actually have in hand.
> 
> There are going to be one or two holes in this - I think that it will not
> deal with pictures for example - but it could well be a way to start.
> 
> Yours
> 
> Mark B
> 
-- 
View this message in context: http://old.nabble.com/Extract-Text-with-style-type-information-tp27209960p27275276.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