Skip to content

Working with Text Search in .NET MAUI PDF Viewer #55

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

deepika134
Copy link
Collaborator

An example added for Working with Text Search in .NET MAUI PDF Viewer

@@ -0,0 +1,24 @@

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
  1. The sample is in TextSearch folder which is fine.
  2. We may need to add a folder inside (with folder name based on use case) and add the sample. because in future we may add text search samples inside this folder.


// Load the PDF document from embedded resources.
Stream? stream = typeof(MainPage).GetTypeInfo().Assembly.GetManifestResourceStream("TextSearch.Assets.PDF_Succinctly.pdf");
PdfViewer.LoadDocument(stream!);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Here force not null operator is used. Please check with null as below

if (stream != null)

}

// Searches for the specified text asynchronously and stores the result.
async void SearchText(string text)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Searches for the specified text asynchronously and stores the result.
async void SearchText(string text)
{
SearchResult = await PdfViewer.SearchTextAsync(text);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We may need to show the search progress to the users. Did we handle it? https://help.syncfusion.com/maui/pdf-viewer/text-search#text-search-progress
  2. We may need to show the search completion to the users. Did we use any "Search completed', "no matches found" kind of things?

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

Successfully merging this pull request may close these issues.

2 participants