DocuLift 1.0.2 is a C# library that lifts text out of office files on the machine where your app runs. This release makes a PDF table come out as a table.
Load a PDF, Word file, PowerPoint deck, RTF file, or plain text file. One call returns a string, a TXT file, or Markdown. Documents are not uploaded. The library makes no runtime call to DocuLift.
PDF tables keep their cells. When two or more rows share the same columns, Markdown becomes a pipe table. A cell can hold more than one word, so New York stays one cell. Plain text and TXT pad those columns so they line up. A single line with two distant phrases, such as a title on the left and a date on the right, stays a paragraph.
You can print the box with the word. PDF words already carry a BoundingBox in PDF user space, origin at the bottom-left of the page. Set IncludeCoordinates and String, TXT, and Markdown append [left,bottom,right,top]. A table cell gets one box around the whole cell. The same flag does nothing for TXT, RTF, Word, or PowerPoint, because those formats have no boxes. Leave the flag off and the text is unchanged.
using Doculift;
Document doc = Document.Load(@"C:\docs\invoice.pdf");
string markdown = doc.Convert(OutputFormat.Markdown).ToString();
string withBoxes = doc.Convert(
OutputFormat.String,
new ConvertOptions { IncludeCoordinates = true }).ToString();
A coordinate line looks like Region [50.00,688.64,86.67,699.64]. The four numbers are left, bottom, right, and top.
| Reads | .txt, .rtf, .pdf, .docx, .pptx |
| Returns | a string, a TXT file, or Markdown |
| Runs on | .NET Core 3.1 through .NET 10, via netstandard2.1 and net10.0 |
| Does not target | .NET Framework |
Word and PowerPoint Markdown keeps headings, lists, and tables. PDF text follows reading order and keeps words on the same line when they share a baseline. Images are left out. A filled PDF form field is included as Customer: Acme. An encrypted PDF opens when you pass the password to Load.
Document doc = new Document(@"C:\docs\notes.docx");
string markdown = doc.Convert(OutputFormat.Markdown).ToString();
Document locked = Document.Load(@"C:\docs\secret.pdf", "the-password");
locked.SaveAsTxt(@"C:\docs\secret.txt");
Anything other than txt, rtf, pdf, docx, and pptx throws FileNotSupportedException. This version does not write a new PDF, Word file, or slide deck, and it does not read scanned images.
dotnet add package DocuLift --version 1.0.2
Request a trial key at https://www.doculift.org/#trial. The key arrives by email. Put it in configuration, not in C#:
{
"Doculift": {
"LicenseKey": "YOUR-KEY"
}
}
Or set DOCULIFT_LICENSE_KEY. A trial key starts with DoculiftTrialKey- and carries its own expiry date. A full key starts with DoculiftLicenseKey- and has no end date. The same NuGet package is used for both.
Questions about a license: licensing@doculift.org
Package page: nuget.org/packages/DocuLift