Hi all,
We are experiencing some issues when calling FindText.
Prior to release 2.53 we had an issue where when highlighting text, it would shrink all matches within the viewer.
After the release, the problem was resolved but now it seems we are experiencing other issues.
1) When searching for text with a space, it does not find any results, yet if you remove the space, it finds the results that should have matched with a space.
i.e. match all strings with "Web Site" returns no matches but when searching for "WebSite" it matches all those strings that appear "Web Site"
2) If you search for something that does not exist, it reports there are results. If you step through the code, it returns the correct results.
It seems that if you set the breakpoint before
in the following code, then whilst stepping through, result returns a valid result. If you set a breakpoint afterwards, it does not.
pdfViewer1.Command(WPViewPDF.commands.COMPDF_FindGotoPage, 1);
pdfViewer1.Command(WPViewPDF.commands.COMPDF_FindCaseInsitive, caseInsensitive ? 1 : 0);
if (caseInsensitive)
{
pdfViewer1.Command(WPViewPDF.commands.COMPDF_FindAltText, textToFind.ToUpper());
textToFind = textToFind.ToLower();
}
int result;
if (findNext)
result = pdfViewer1.Command(WPViewPDF.commands.COMPDF_FindNext, textToFind);
else
result = pdfViewer1.Command(WPViewPDF.commands.COMPDF_FindText, textToFind);
if (result < pdfViewer1.Command(WPViewPDF.commands.COMPDF_GetPageCount))
{
pdfViewer1.Command(WPViewPDF.commands.COMPDF_HighlightText, textToFind);
pdfViewer1.Command(WPViewPDF.commands.COMPDF_GotoPage, result + 1);
}
else
{
pdfViewer1.Command(WPViewPDF.commands.COMPDF_HighlightText, "");
MessageBox.Show(this, "Cannot find \"" + textToFind + "\"", "Find error");
}
Alles anzeigen
Has anyone come across this issue? The code is being called on an click event from a button.
I'd appreciate anyone's help on this!
Regards
Gav