Hi,
Thank you for your inquiry.
I have created a console project (. NET Framework 4. 8 ) to test the file you provided through the latest version Spire.PDF for .NET 9.10.2, but I didn't reproduce your issue. Did you use the latest version of Spire.PDF for .NET? if not,Please download the latest version and retest through this link(
https://www.e-iceblue.com/Download/download-pdf-for-net-now.html).
I put the complete code below for your referenece:
- Code: Select all
//Create a PdfDocument object
PdfDocument doc = new PdfDocument();
//Load PDF file
doc.LoadFromFile(@"E:\\34831\\metro\\metro.pdf");
PdfPageBase page = doc.Pages[1];
//Create a PdfTextExtractot object
PdfTextExtractor textExtractor = new PdfTextExtractor(page);
//Create a PdfTextExtractOptions object
PdfTextExtractOptions extractOptions = new PdfTextExtractOptions();
//Set isExtractAllText to true
extractOptions.IsExtractAllText = true;
//Extract text from the selected page
string text = textExtractor.ExtractText(extractOptions);
//Write the extracted text to a TXT file
File.WriteAllText(@"E:\\34831\\metro\\ToText.txt", text);
If above message doesn’t help you, please offer the following information to help us do further investigation. Thank you in advance.
1)Your full test code that can reproduce your issue.
2)Application type, such as Console App, .NET Framework 4.8.
3)Your test environment, such as OS info (E.g. Windows 7, 64-bit).
Sincerely,
Ula
E-iceblue support team