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

Feature Request: Highlight Multiline Sentences #261

Open
prakash-O4 opened this issue Nov 28, 2024 · 1 comment
Open

Feature Request: Highlight Multiline Sentences #261

prakash-O4 opened this issue Nov 28, 2024 · 1 comment

Comments

@prakash-O4
Copy link

First of all, Thank you for creating and maintaining this fantastic package! It has been a great help in my flutter web project, and I truly appreciate your efforts.

Currently, the highlighting functionality works well for single words or short phrases. However, when users search for or interact with multiline sentences, the system does not return results or highlight the relevant sections in the document.

  • Proposed Behavior:

Allow highlighting of multiline sentences or longer text spans that match the query.
When users search or chat with the document, ensure that the entire matched section (even across multiple lines) is highlighted to provide context.

Example:

Query: "The optimization techniques include caching and parallel processing."
Current: No results or only partial words are highlighted.
Proposed: Highlight the entire multiline sentence:
"The optimization techniques include caching and parallel processing to enhance system performance."

Questions:

  • Is there currently support for multiline sentence highlighting?
  • If not, could this feature be implemented?

Thank you again for your hard work on this package. This feature would make the tool even more user-friendly and powerful. Please let me know if you need further clarification or additional details!

@espresso3389
Copy link
Owner

The most challenging part of multiline search is the line ending conditions. The existence of the line-terminators such as CR, LF, or just spaces depend on PDF generator.

By the way, pdfrx's text searching uses PDF page's full text. So if you can implement some algorithm to search text on it regardless of the line terminators, you can get the corresponding text fragment (PdfPageTextFragment ) index using PdfPageText.getFragmentIndexForTextIndex.

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

No branches or pull requests

2 participants