|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor
public class QuickButCruddyTextExtractor
This class will get all the text from a Powerpoint Document, including all the bits you didn't want, and in a somewhat random order, but will do it very fast. The class ignores most of the hslf classes, and doesn't use HSLFSlideShow. Instead, it just does a very basic scan through the file, grabbing all the text records as it goes. It then returns the text, either as a single string, or as a vector of all the individual strings. Because of how it works, it will return a lot of "crud" text that you probably didn't want! It will return text from master slides. It will return duplicate text, and some mangled text (powerpoint files often have duplicate copies of slide text in them). You don't get any idea what the text was associated with. Almost everyone will want to use @see PowerPointExtractor instead. There are only a very small number of cases (eg some performance sensitive lucene indexers) that would ever want to use this!
Constructor Summary | |
---|---|
QuickButCruddyTextExtractor(java.io.InputStream iStream)
Creates an extractor from a given input stream |
|
QuickButCruddyTextExtractor(POIFSFileSystem poifs)
Creates an extractor from a POIFS Filesystem |
|
QuickButCruddyTextExtractor(java.lang.String fileName)
Creates an extractor from a given file name |
Method Summary | |
---|---|
void |
close()
Shuts down the underlying streams |
int |
findTextRecords(int startPos,
java.util.Vector textV)
For the given position, look if the record is a text record, and wind on after. |
java.lang.String |
getTextAsString()
Fetches the ALL the text of the powerpoint file, as a single string |
java.util.Vector |
getTextAsVector()
Fetches the ALL the text of the powerpoint file, in a vector of strings, one per text record |
static void |
main(java.lang.String[] args)
Really basic text extractor, that will also return lots of crud text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QuickButCruddyTextExtractor(java.lang.String fileName) throws java.io.IOException
fileName
-
java.io.IOException
public QuickButCruddyTextExtractor(java.io.InputStream iStream) throws java.io.IOException
iStream
-
java.io.IOException
public QuickButCruddyTextExtractor(POIFSFileSystem poifs) throws java.io.IOException
poifs
-
java.io.IOException
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public java.lang.String getTextAsString()
public java.util.Vector getTextAsVector()
public int findTextRecords(int startPos, java.util.Vector textV)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |