ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEnView1.PdfViewer.Find returns always True
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

132 Posts

Posted - Sep 25 2023 :  09:11:44  Show Profile  Reply
Hi,

reguarding ImageEnView1.PdfViewer.Find the manual says: Result is False if there are no instances of the search text.

Thus, the following code should show a message box only if the search term had been found inside the PDF, but the box pops always up, even if the search term doesn't exist in the file.

Example: Searching for the word "Adobe" inside a PDF document which contains only the words "Product1 Product2" shows a message box with the string "Product1".

IsFound := ImageEnView1.PdfViewer.Find('Adobe', True, True, False, False, False);
if IsFound then
  begin
    ImageEnView1.PdfViewer.FindNext(wordIdx, wordLen, False, False);
    ImageEnView1.PdfViewer.SelectWord(wordIdx);
    ShowMessage(ImageEnView1.PdfViewer.SelText);
  end;

Searching for non contained words returns always "IsFound = True", "wordIdx = 0" and "wordLen = 0". What am I missing?

Ale

xequte

38590 Posts

Posted - Sep 25 2023 :  18:09:56  Show Profile  Reply
Hi Ale

Yes, there is an issue whereby PDFViewer.Find() always returns true when Select parameter is false. You can email me for a fix.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: