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 May 02, 2019 8:36 am

Hello,

Thanks for your update.
Using LoadFromStream() way, I also didn't encounter any issue. Here I uploaded my testing application, please run it directly on your side. If there is still any question, please provide your testing environment, such as your system configuration (Windows7, 64-bit) and the region information (China,Chinese) to help us further look into it. Look forward to your feedback.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu May 02, 2019 8:58 am

Lisa.Li wrote:Hello,

Thanks for your update.
Using LoadFromStream() way, I also didn't encounter any issue. Here I uploaded my testing application, please run it directly on your side. If there is still any question, please provide your testing environment, such as your system configuration (Windows7, 64-bit) and the region information (China,Chinese) to help us further look into it. Look forward to your feedback.

Sincerely,
Lisa
E-iceblue support team



Hi Lisa,

Putting the .LoadFromStream issue aside, I realised that there are some word duplicates produced at some lines.

Am I right to assume that currently there is no solution from the Dev Team regarding this as that is how Spire extract text from PrinceXML PDFs?


Best Regards,
Fabian

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Thu May 02, 2019 10:22 am

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
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Fri May 03, 2019 1:50 am

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

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Fri May 03, 2019 2:51 am

Hello,

Thanks for your more information.
I understood the duplicate characters that you referred to, like I replied to you before that this issue is caused by your PrinceXML PDF itself, you can found there are multiple layers and word duplicates in your original PrinceXML PDF file by Foxit PDF Editor. The attached screenshot is for your reference. Sorry that there is no better way to fix this issue now, please standardize your PrinceXML PDF to get rid of this issue. If there is any question, just feel free to write back.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Fri May 03, 2019 2:59 am

Lisa.Li wrote:Hello,

Thanks for your more information.
I understood the duplicate characters that you referred to, like I replied to you before that this issue is caused by your PrinceXML PDF itself, you can found there are multiple layers and word duplicates in your original PrinceXML PDF file by Foxit PDF Editor. The attached screenshot is for your reference. Sorry that there is no better way to fix this issue now, please standardize your PrinceXML PDF to get rid of this issue. If there is any question, just feel free to write back.

Sincerely,
Lisa
E-iceblue support team


Hi Lisa,

Thank you for the prompt response and the follow-ups throughout this post :)
Appreciate it.

Best Regards,
Fabian

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Fri May 03, 2019 3:39 am

Hello,

Thanks for your feedback. If you need other helps, just feel free to contact us.
Have a nice day!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF

cron