Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jun 11, 2020 12:41 pm

Dear Sirs,

The related code extracts the text from PDF file. Observe in the attached file, that the return results in an incorrect character. If you copy and paste the same information in the PDF file, the result is ok.


using (Spire.Pdf.PdfDocument pdf = new Spire.Pdf.PdfDocument())
//Load the PDF file
{
pdf.LoadFromFile(p_PDF);
PdfPageBase page = pdf.Pages[0];// newPdf.Pages[0]; //pdf.Pages[0];

// Extract text from a specific rectangular area within the page
string text = page.ExtractText();

text = Regex.Replace(text, "[\r\n\t]", "");
text = text.Trim().Replace("\r\n", string.Empty);
vPDFExtracALL.Add(p_PDF, text);
return text;
}

Dicipulofer
 
Posts: 24
Joined: Wed Apr 08, 2015 1:41 pm

Fri Jun 12, 2020 1:57 am

Hello,

Thanks for your inquiry.
I tested your case with the latest Spire.PDF Pack(Hot Fix) Version:6.5.15, but found the extracted text was correct, attached is my output. If you are using an older version, please download the latest version and try again.
If the issue still happens, please tell us your OS information (E.g. Windows7, 64bit) and region setting (E.g. China, Chinese) for further investigation. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Jun 17, 2020 10:06 am

Hello,

Greetings from E-iceblue.
Has your issue been resolved? Any feedback will be greatly appreciated!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF