Section 1 · Terms
Section 2 · Schedule
The ExpertPdf PDF to Text Converter extracts the text from a PDF document in any type of .NET
application. The result is a .NET String you can use in search operations or save to a
file on disk. No installation is needed to run the converter.
Keep the original PDF layout or extract in reading order, choose the pages, open password protected documents, mark the page breaks, save the text as HTML with meta tags from the PDF description, and search for text with its page and position.
Grouped by how the text comes out of the PDF document and what you get back.
From a file or a stream, in the original layout or in reading order, from the pages you choose, from password protected documents.
Pass the path of a PDF file, or a Stream such as a FileStream or a MemoryStream holding the PDF bytes.
The default layout keeps the text where it was on the page: a page with two columns of text gives two columns of text.
In reading order, two columns of text become two blocks of text, one after the other.
Extract only a range of pages with StartPageNumber and EndPageNumber. By default all the pages are extracted.
Open password protected documents with the UserPassword property.
GetPageCount returns the number of pages of a PDF file or stream.
GetDocumentInformation returns the title, author and page count, and the size and rotation of every page, without extracting the text.
A string or an HTML document, page break marks, and the positions of the text you search for.
StringConvertToText returns the text as a .NET String you can search or save to a file on disk.
ConvertToTextPages returns one string per page, in one call.
Save the text in an HTML document with the title, subject, keywords and author from the PDF document description as meta tags.
Insert a special character after the text of each page. The character is given by PdfToTextConverter.PAGE_BREAK_MARK.
Search for a text and get the page number and the position on the page (X, Y, width and height) of every match.
SearchTexts searches for several terms in one pass, with the results grouped by term and page. Arabic and other non-Latin text is found whatever the character forms in the PDF.
ExtractTextAtCoords returns the text inside a rectangle of a given page.
The PdfToTextConverter class: extract text from a file, save it as HTML from a stream, and search for text. All the properties and methods are in the API reference.
using ExpertPdf; var converter = new PdfToTextConverter(); converter.Layout = TextLayout.ReadingLayout; converter.MarkPageBreaks = true; converter.StartPageNumber = 1; converter.EndPageNumber = 5; // From a file path, or from a Stream with ConvertToText(stream) string text = converter.ConvertToText("contract.pdf"); File.WriteAllText("contract.txt", text, System.Text.Encoding.UTF8);
The download includes a ready-to-use sample application with its full C# and VB.NET source code.
Install from NuGet with dotnet add package ExpertPdf.PdfToText, or read the developer's guide.
Common questions about layouts, output, page ranges and search.
TextLayout.OriginalLayout, the text keeps its layout from the PDF page: a page with two columns of text gives two columns of text. With TextLayout.ReadingLayout, the same page gives two blocks of text, one after the other. Choose the layout with the Layout property.String with the extracted text, which you can search or save to a file. When AddHtmlMetaTags is true, the text is placed in an HTML document whose meta tags hold the title, subject, keywords and author from the PDF document description. The charset meta tag is set by HtmlCharset and is UTF-8 by default.UserPassword property to the password that opens the document.StartPageNumber and EndPageNumber properties. By default the text of all the pages is extracted.ExtractTextPositions searches a PDF file or stream for a text, case sensitive or not, whole words only or not, and returns a TextPosition for each match, with the page number, X, Y, width and height. ExtractTextAtCoords does the opposite: it returns the text inside a rectangle of a given page.ConvertToTextPages returns one string per page, and SearchTexts searches for several terms in one call, with the results grouped by term and by page, including their positions.ExpertPdf.PdfToText package from NuGet, or copy eppdftotext.dll and eptools.dep from the download to the bin folder of your application and reference eppdftotext.dll.ExpertPdf.PdfToText.x64, is also available for applications that run as x64 processes.Download the free evaluation with the C# and VB.NET sample application. When you are ready, license it on the pricing page.