Lisa.Li wrote:Hello,
This issue is caused by your sample PDF itself, please refer to the attached screenshot that shows there are word duplicates at some lines in your PDF file, you can verify this by Foxit PDF Editor. Our Spire.PDF just extracts out all the text. I suggest you standardize your document and then test again.
Sincerely,
Lisa
E-iceblue support team
Hi Lisa,
I will send another PrinceXML PDF to
[email protected].
You can then test the PDF with the codes below and you will understand the duplicates I'm referring:
private void ExtractPdfText()
{
string partialText = "";
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromFile(@"C:\Users\TestUser\Desktop\Admin_Note.pdf");
int pageCount = doc.Pages.Count;
Debug.WriteLine("NUMBER OF PAGES IS: " + pageCount);
//Extract text from page
for (int i = 0; i < pageCount; i++)
{
//***********CONDITION TO CHECK FOR CREDIT BALANCE PDF******************
if (i == 0)
{
partialText = doc.Pages[0].ExtractText(new Rectangle(-10, 790, 600, 40));
StringBuilder sb = new StringBuilder();
sb.AppendLine(partialText);
string s = partialText.Substring(70, partialText.Length - 70);
Debug.WriteLine(s);
}
}
}
The output should be something like:
ABC(S) Pte Ltd |
www.abc.com.sgFor enquiries, please contact us at
1 Anderson Road 21 Singapore 600000 | Tel: (65) 6281 0000EEmmaaiill:: bbiillll__eennqquuiirriieess@@aabbcc..ccoomm..ssgg
Company Registation No. 02918212A | GST Reg No. M1-9292929-2TTeell:: ++6655 66999999 99999999
The duplicates I'm referring to is something like: " bbiillll__eennqquuiirriieess@@aabbcc..ccoomm..ssgg".
Is this issue solvable by Spire or is it PrinceXMLs issue and it is not solvable at the moment?
I appreciate your attention throughout this post. Thank you and I look forward to hear from you.

Best Regards,
Fabian