This sample shows how to extract text from a 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.
The alternative methods are PdfDocument.GetTextWithFormatting and PdfPage.GetTextWithFormatting. These methods extract text with formatting. Formatting means that all relative text positions will be kept after extraction and the text will look more readable. Extracting text with formatting may be especially useful for PDF documents with tabular data.