Closed vikramsoni2 closed 5 months ago
the highlighting of text is very unstable. if there is one italic or bold text in the line, that line does not highlight.
I would like to second this. It would be a great addition if you could it make this possible.
Will it be made possible to add more than one highlighted sentence per page at some point?
Btw good job creating this package!
I would like to know your use cases.
The highlight-text
prop is more like a "search and highlight the results" similar to ctrl + f
feature on browsers.
I would like to use the current functionality but to highligt multiple sentences on a page.
Lets say I have a page where both of these sentences are included: Lorem ipsum dolor
and Aenean bibendum faucibus
. Right now it's only possible to highlight one of them. I would like to be able to highlight both of them.
I would like to know your use cases.
The
highlight-text
prop is more like a "search and highlight the results" similar toctrl + f
feature on browsers.
I did some experiments, it works as long as the text layer does not have any decoration ( i.e. bold or any other styles). when you have a pdf which has any styles, it cannot select those elements. It can select multiple lines of text if the texts are just plain-text. but if there is any other decoration, I see that the text layer creates spans to adjust the style, and that's where the highlighting breaks.
The use-case: I have Chat-bot which answers the questions from the PDF, and also provide the chunk of the pdf which was used to answer the question. ( the chunk is just text, not formatted text(. and I want to highlight the chunk.
I did some experiments, it works as long as the text layer does not have any decoration ( i.e. bold or any other styles). when you have a pdf which has any styles, it cannot select those elements. It can select multiple lines of text if the texts are just plain-text
Could you share the pdf of this issue? @vikramsoni2
I did some experiments, it works as long as the text layer does not have any decoration ( i.e. bold or any other styles). when you have a pdf which has any styles, it cannot select those elements. It can select multiple lines of text if the texts are just plain-text
Could you share the pdf of this issue? @vikramsoni2
here you go. just created a small app for demo purpose. if you notice, I am trying to highlight the same paragraph in both pages. the first one includes a small decoration in the text which breaks the highlight. in the second page, I remove the last ward to not include that decorated text and it works.
https://stackblitz.com/edit/vitejs-vite-xcgtmn?file=src%2FApp.vue
Any updates on this? this would be a great feature.
If I want to highlight a paragraph of text, how do I do it? I see that the text-layer is generating spans of text for each lines. is there an easier way to pass a sentence in the highlight-text param so that it highlights the entire sentence ?
awesome work by the way!