DocuLift 1.0.2
dotnet add package DocuLift --version 1.0.2
NuGet\Install-Package DocuLift -Version 1.0.2
<PackageReference Include="DocuLift" Version="1.0.2" />
<PackageVersion Include="DocuLift" Version="1.0.2" />
<PackageReference Include="DocuLift" />
paket add DocuLift --version 1.0.2
#r "nuget: DocuLift, 1.0.2"
#:package DocuLift@1.0.2
#addin nuget:?package=DocuLift&version=1.0.2
#tool nuget:?package=DocuLift&version=1.0.2
DocuLift
C# library that extracts text from PDF, DOCX, PPTX, RTF, and TXT. One call converts a file to a string, a TXT file, or Markdown. Each PDF word keeps its page coordinates.
Website: https://www.doculift.org/ Trial key: https://www.doculift.org/#trial Email: licensing@doculift.org
using Doculift;
Document doc = new Document("hello.txt");
string text = doc.Convert(OutputFormat.String).ToString();
Console.WriteLine(text);
Enter your email at https://www.doculift.org/#trial and the trial key arrives by email. Then set DOCULIFT_LICENSE_KEY, or put this beside the app and copy it to the output directory:
{
"Doculift": {
"LicenseKey": "YOUR-KEY"
}
}
Install
dotnet add package DocuLift --version 1.0.2
.NET Standard 2.1 and .NET 10. .NET Standard 2.1 runs on .NET Core 3.1 through .NET 10. .NET Framework is not a target.
Reads .txt, .rtf, .pdf, .docx, and .pptx. Anything else throws FileNotSupportedException.
PDF text extraction
Document doc = Document.Load(@"C:\docs\invoice.pdf");
string text = doc.Convert(OutputFormat.String).ToString();
Text follows reading order and keeps words on the same line when they share a baseline. Images are left out. A filled form field is included as Customer: Acme.
PDF text coordinates
Each PDF word is a Document.TextBlock with a BoundingBox in PDF user space. The origin is the bottom-left of the page. Convert prints a box only when IncludeCoordinates is set. TXT, RTF, DOCX, and PPTX have no boxes, so the flag does nothing for them.
Document doc = Document.Load(@"C:\docs\invoice.pdf");
string text = doc.Convert(OutputFormat.String, new ConvertOptions { IncludeCoordinates = true }).ToString();
A word then looks like Region [50.00,688.64,86.67,699.64]. The four numbers are left, bottom, right, and top. A table cell uses one box around the whole cell, so New York stays one cell. page.Width and page.Height are the page size in the same space. You can also read word.Bounds from the document.
PDF and DOCX to Markdown
Document doc = Document.Load(@"C:\docs\notes.docx");
string markdown = doc.Convert(OutputFormat.Markdown).ToString();
Headings, lists, and tables become Markdown. Conversion.Save writes that text to a file. A PDF table becomes a pipe table when two or more rows share column positions. A cell can hold more than one word, such as New York. Plain text pads those columns so they line up. Other PDF lines stay paragraphs.
Password-protected PDF
Document doc = Document.Load(@"C:\docs\invoice.pdf", "secret");
string text = doc.Convert(OutputFormat.String).ToString();
A missing or wrong password fails Load. Other formats ignore the password.
Load from bytes
byte[] bytes = File.ReadAllBytes(@"C:\docs\invoice.pdf");
Document doc = Document.Load(bytes);
string text = doc.Convert(OutputFormat.String).ToString();
Save a TXT file
Document doc = Document.Load(@"C:\docs\slides.pptx");
doc.SaveAsTxt(@"C:\docs\slides.txt");
A trial key starts with DoculiftTrialKey-. A full key starts with DoculiftLicenseKey-. OCR and speech-to-text are not in this version.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- DocumentFormat.OpenXml (>= 3.5.1)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.12)
- Microsoft.Extensions.Configuration.Json (>= 10.0.12)
- System.Text.Encoding.CodePages (>= 8.0.0)
-
net10.0
- DocumentFormat.OpenXml (>= 3.5.1)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.12)
- Microsoft.Extensions.Configuration.Json (>= 10.0.12)
- System.Text.Encoding.CodePages (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- PDF tables keep multi-word cells such as New York, and plain text lines the columns up.
- Set ConvertOptions.IncludeCoordinates to append PDF boxes as [left,bottom,right,top].