Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 1.27 KB

File metadata and controls

11 lines (8 loc) · 1.27 KB

Convert PDF to text in C# and VB.NET

This sample shows how to extract text from PDF document or from a PDF page in C# and VB.NET.

Use PdfDocument.GetText() or PdfPage.GetText() methods to extract text in plain text format. You can also use PdfCanvas.GetTextData() method to extract text chunks with their coordinates.

Alternative methods are PdfDocument.GetTextWithFormatting() and PdfPage.GetTextWithFormatting(). These methods will extract text with formatting. Formatting means that all relative text positions will be kept after extraction and text will look more readable. Extracting text with formatting may be especially useful for PDF documents with tabular data.

See also