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.

Wed Apr 08, 2020 1:33 pm

Hello,

I'm facing a strange behavior in a FindText function.

To help us to understand the problem, I am attaching two PDF's, Doc 1 and Doc 2. They are similar.

The Image doc1.png, shows the X value returned is around 164, and the doc2.png shows 308.65.

As you can see, the both PDF has the same resolution, so it isn't a problem with scale.

I realize the function return different values to OuterText, maybe this is a key to understand this issue.

Could you help me to understand this problem?


List<PdfTextFind> objBusca = new List<PdfTextFind>();

try
{
objBusca.AddRange(p_page.FindText("CPF/CNPJ", TextFindParameter.None).Finds);
...

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

Thu Apr 09, 2020 3:49 am

Hello,

Thanks for your inquiry.
I opened your two files in Adobe, but found the text "CPF/CNPJ" in the two files is not in the same position, please see the attached screenshot. Thus, when using the method "FindText" to find the text "CPF/CNPJ" in your two files, it will return different X values.

Sincerely,
Rachel
E-iceblue support team
User avatar

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

Return to Spire.PDF