Render whole textLayer without scrolling
See original GitHub issueHello!
How do I configure the pdf,js standard viewer to render all pages without waiting for the user to scroll down to the different pages so that pdf.js renders the pages? I know about the possibility to extract the text from the pdf, but I really need the textLayer.
My use case:
I need the whole ‘textLayer’ for all pages, because I analyze the words given in the layer and highlight some of them (the ones which satisfy my defined rules) by putting them in a span: <span class="highlight selected">word</span>
.
Thank you in advance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Prevent body scrolling but allow overlay scrolling
Problem with this solution is that it only works if overlay is scrollable. If you have a modal and it all fit on...
Read more >text-rendering - CSS: Cascading Style Sheets - MDN Web Docs
The text-rendering CSS property provides information to the rendering engine about what to optimize for when rendering text.
Read more >Creating and editing text layers in After Effects - Adobe Support
You can animate the properties of entire text layers or the properties of ... When animating text to move vertically—for scrolling credits, ...
Read more >Seamless, infinitely scrolling text in After Effects - YouTube
Join me, and experience the joy of seamlessly scrolling text of any duration by using a nested composition and the simple loopOut() ...
Read more >Scrolling-Aware Rendering to Reduce Frame Rates on ... - MDPI
Frame display process of SurfaceFlinger: (a) layers; (b) frame display flow. ... The pre-rendering is applicable to all the types of views (e.g.,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
See e.g. https://stackoverflow.com/a/40662025/1765767
It’s a small project by itself – you need to modify viewer to modify text layer out to add these spans. There is no easy answer here and you need start looking at the https://github.com/mozilla/pdf.js/blob/master/src/display/text_layer.js and/or https://github.com/mozilla/pdf.js/blob/master/web/text_layer_builder.js to modify that. Good luck.
Closing as answered.
Thanks @stefanos113. Here’s some working simple example code:
Perhaps worth pointing out that the approach you and I are both using ignores the highlighting which pdf.js already provides for searches, so there might be a way within the library to ask it to do the highlighting itself, but again I’m not sure how, if at all, at this stage!