Reading PDF document in C#
Reading PDF document
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Reading PDF document in C#
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
ChloeRank #7,584 · 238 reputationPosted Sep 21, 2026, 10:49 PM EDT
You can use Spire.PDF for .NET to read PDF documents. It supports extracting text, tables, images, and reading form fields.
Simplest text extraction example:
using Spire.Pdf; using Spire.Pdf.Texts; PdfDocument pdf = new PdfDocument(); pdf.LoadFromFile("sample.pdf"); foreach (PdfPageBase page in pdf.Pages) { PdfTextExtractor extractor = new PdfTextExtractor(page); // Create and configure the options PdfTextExtractOptions options = new PdfTextExtractOptions(); options.IsExtractAllText = true; // Extract the entire page // Pass options into ExtractText Console.WriteLine(extractor.ExtractText(options)); } pdf.Close();Bohdan StupakRank #479 · 5.2K reputationPosted Mar 25, 2026, 10:41 AM EDT
You can use pdfpig package for this matter.