Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfDocumentProcessor.GetText() Method

Retrieves the document content.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v24.2.dll

NuGet Package: DevExpress.Document.Processor

#Declaration

public string GetText()

#Returns

Type Description
String

The text obtained from the document.

#Remarks

The GetText method uses the page coordinate system. Refer to the following help topic for more details: Coordinate Systems.

Set the PdfTextExtractionOptions.ClipToCropBox property to false and pass the PdfTextExtractionOptions object as the method parameter to extract document content without clipping to the crop box.

The code sample below retrieves all document content:

using (DevExpress.Pdf.PdfDocumentProcessor processor =
 new DevExpress.Pdf.PdfDocumentProcessor())
{
    processor.LoadDocument("TextExtraction.pdf");

    string pageText = processor.GetText();
    Console.WriteLine(pageText);
}
See Also