How to render text layer
See original GitHub issueI am trying to render the text content of a PDF as is done here. I wasn’t able to find an exposed API that would support this, event though #858 makes reference to page.renderTextLayer
. Digging through the source I was able to find page.getTextContent
and was able to get PDFJS.renderTextLayer
by including src/display/text_layer.js
in my source. Even then the text layer doesn’t render as expected.
Two questions:
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How to Enable Text Selection in PDF.JS - UsefulAngle
This method is renderTextLayer. As can be seen from the name, the method renders the text as a layer over the PDF. PDF....
Read more >Generating the text layer - question regarding the textLayer ...
Parameter object supports: 'textLayer'. So I'm to assume I can do my render command like so: var renderContext = { canvasContext: ctx, textLayer:...
Read more >pdf.js with text selection - javascript - Stack Overflow
On pdf.js version 2.8.61, the checked answer does no more work, as renderTextLayer() is integrated to pdf.js, no more outside source is ...
Read more >Rendering Text In Just One Click - Planet Photoshop
If you need to convert your Type layer into an image layer, you can save some time by simply Control-clicking (PC: Right-clicking) directly ......
Read more >Text layer - ngx-extended-pdf-viewer
By default, the text layer is switched off in order to render the document faster. The drawback is that both the find menu...
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
Hello,guys,i know how to do that. 1、incllude CSS file in your page
<link rel="stylesheet" href="../../node_modules/pdfjs-dist/web/pdf_viewer.css">
2、create a text layer div with the following code<div id="textlayer"></div>
3、replace js code: page.render(renderContext); to the following code