VOOZH about

URL: https://www.nuget.org/packages/DocumentTextExtractor/

⇱ NuGet Gallery | DocumentTextExtractor 1.0.10




👁 Image
DocumentTextExtractor 1.0.10

dotnet add package DocumentTextExtractor --version 1.0.10
 
 
NuGet\Install-Package DocumentTextExtractor -Version 1.0.10
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DocumentTextExtractor" Version="1.0.10" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DocumentTextExtractor" Version="1.0.10" />
 
Directory.Packages.props
<PackageReference Include="DocumentTextExtractor" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DocumentTextExtractor --version 1.0.10
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DocumentTextExtractor, 1.0.10"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DocumentTextExtractor@1.0.10
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DocumentTextExtractor&version=1.0.10
 
Install as a Cake Addin
#tool nuget:?package=DocumentTextExtractor&version=1.0.10
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

👁 documenttextextractor

DocumentTextExtractor

Simple C# library for extracting text and metadata from .docx, .pptx, and .xlsx files

👁 NuGet Version
👁 NuGet

DocumentTextExtractor provides simple methods for extracting text and metadata from .docx, .pptx, and .xlsx files.

New in v1.0.x

  • Initial release
  • Support for docx, pptx, xlsx, and pdf
  • Contextual extraction for pptx, xlsx

Disclaimer

This library has been tested on a limited set of documents. It is highly likely that documents exist this from which the library, in its current state, cannot extract text.

The PDF implementation relies upon PDFSharp and PDFPlumber. The latter is written in Python and requires that you have installed Python and used pip to install the pdfplumber package.

Simple Examples

Refer to the Test project for a full example.

using DocumentTextExtractor;

void Main(string[] args)
{
 using (DocxTextExtractor docx = new DocxTextExtractor("./temp/", "mydocument.docx"))
 {
 string docxText = docx.ExtractText();
 Dictionary<string, string> docxMetadata = docx.ExtractMetadata();
 }

 using (PptxTextExtractor pptx = new PptxTextExtractor("./temp/", "mypresentation.pptx"))
 {
 string pptxText = pptx.ExtractText();
 Dictionary<string, string> pptxMetadata = pptx.ExtractMetadata();
 }

 using (XlsxTextExtractor xlsx = new XlsxTextExtractor("./temp/", "myspreadsheet.xlsx"))
 {
 string xlsxText = xlsx.ExtractText();
 Dictionary<string, string> xlsxMetadata = xlsx.ExtractMetadata();
 }

 using (PdfTextExtractor pdf = new PdfTextExtractor("myfile.pdf"))
 {
 string pdfText = pdf.ExtractText();
 Dictionary<string, string> pdfMetadata = pdf.ExtractMetadata();
 }
}

Contextual Extraction

For certain document types (e.g. pptx and xlsx) text can be extracted with an identifier for the slide or sheet number associated with the document.

using (PptxTextExtractor pptx = new PptxTextExtractor("./temp/", "mypresentation.pptx"))
{
 IEnumerable<KeyValuePair<int, string>> slideContent = pptx.ExtractTextBySlide();
 foreach (KeyvaluePair<int, string> kvp in slideContent)
 {
 Console.WriteLine("Slide " + kvp.Key + ": " + kvp.Value);
 }
}

using (XlsxTextExtractor xlsx = new XlsxTextExtractor("./temp/", "mypresentation.pptx"))
{
 IEnumerable<KeyValuePair<int, string>> sheetContent = xlsx.ExtractTextBySheet();
 foreach (KeyvaluePair<int, string> kvp in sheetContent)
 {
 Console.WriteLine("Sheet " + kvp.Key + ": " + kvp.Value);
 }
}

Version History

Please refer to CHANGELOG.md.

Product Versions Compatible and additional computed target framework versions.
.NET net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 is compatible.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.10 1,169 10/5/2024
1.0.9 264 7/25/2024
1.0.8 289 3/27/2024
1.0.7 294 3/27/2024
1.0.6 299 3/27/2024
1.0.5 284 3/27/2024
1.0.4 270 3/26/2024
1.0.3 1,776 8/11/2023

Initial release