Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinForms Example - Find not correctly selecting next match. #4542

Open
1 task done
lutz-fechner opened this issue Jul 4, 2023 · 6 comments
Open
1 task done

WinForms Example - Find not correctly selecting next match. #4542

lutz-fechner opened this issue Jul 4, 2023 · 6 comments

Comments

@lutz-fechner
Copy link

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

113.1.4

Operating System

Windows 11

Architecture

x86

.Net Version

4.8

Implementation

WinForms

Reproduction Steps

  • Open any PDF file in the browser with "file:///"
  • In the WinForms.Example application click on Edit->Find
  • Enter text in the TextBox and hit Enter
    --> Find(...) method will be executed and found results are marked in the scroll bar at the side
    --> Matching text will not be highlighted and "Find Next", "Find Previous" buttons won't do anything visible to the user (they also do not seem to do from HTML pages)

Expected behavior

Matching content is highlighted (like it is for HTML documents) and the browser scrolls to make the match visible, if not currently visible.

Actual behavior

Matches are only indicated in the scroll bar but no highlighting is visible.

Regression?

No response

Known Workarounds

No response

Does this problem also occur in the CEF Sample Application

No

Other information

Not sure if it is a CefSharp or a CEF issue. The CEF sample application behaves a bit better, but has a different search dialog compared to the WinForms Example that comes with CefSharp.

@amaitland
Copy link
Member

Matches are only indicated in the scroll bar but no highlighting is visible.

The PDF viewer is implemented entirely at the CEF/Chromium level, the example just calls the Find method.

The CEF sample application behaves a bit better

What does that mean exactly? What's a bit better?

No matches in the PDF would be a CEF bug. Test with the latest beta build from https://cef-builds.spotifycdn.com/index.html
If the problem still reproduces then raise an issue on https://github.com/chromiumembedded/cef (search for existing first of course).

@amaitland amaitland added the upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. label Jul 8, 2023
@lutz-fechner
Copy link
Author

A bit better means, it jumops from match to match and marks that current match, but it doesn't highlight all the matches like it does for HTML.

This is like Google Chrome seems to behave as well.

In CefSharp neither of that works.

@amaitland
Copy link
Member

it jumops from match to match and marks that current match

The example likely needs some improvements then. You can compare to the cefclient implementation. PR welcome with improvements.

In CefSharp neither of that works.

That's just the example. Long as the API is mapped correctly you should be able to achieve the same behaviour as cefclient in your application.

Renaming this issue as we'll use to track improvements to the example. The highlight in the PDF will need to be fixed in CEF.

@amaitland amaitland added up-for-grabs and removed upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. labels Jul 8, 2023
@amaitland amaitland changed the title Find in PDF not highlighting search result WinForms Example - Find not correctly selecting next match. Jul 8, 2023
@Sumanta100
Copy link

Open any PDF file in the browser with "file:///"
In the WinForms.Example application click on Edit->Find
Enter text in the TextBox and hit Enter
--> Find(...) method will be executed and found results are marked in the scroll bar at the side
--> Matching text will not be highlighted and "Find Next", "Find Previous" buttons won't do anything visible to the user (they also do not seem to do from HTML pages)

Can you address this issue? If so, could you please provide details on the steps you took to resolve it?

@arighosh2014
Copy link

Hello @lutz-fechner, were you able to solve the issue with the suggestion provided by @amaitland? We are also facing the exact same issue. Just curious if there is any way around it.

@lutz-fechner
Copy link
Author

No I did not solve this issue. When I compared the code of both examples, they looked quite similar to me. Would be better if someone checks this, that has better understanding how the integration between Cef and CefSharp works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants