Extracts a text from the document to which TocItem object refers.
publicvirtualTextReaderExtractText()
Return Value
An instance of TextReader class with the extracted text.
Examples
The following example how to extract a text by the an item of table of contents:
// Create an instance of Parser classusing(Parserparser=newParser(Constants.SampleDocxWithToc)){// Get table of contentsIEnumerable<TocItem>tocItems=parser.GetToc();// Check if toc extraction is supportedif(tocItems==null){Console.WriteLine("Table of contents extraction isn't supported");}// Iterate over itemsforeach(TocItemtocItemintocItems){// Print the text of the chapterusing(TextReaderreader=tocItem.ExtractText()){Console.WriteLine("----");Console.WriteLine(reader.ReadToEnd());}}}