When PDF.js processes a PDF to HTML5, it lays a <canvas>
over all the <div>
elements containing the text. This canvas is a proper render of the PDF, while the text underneath is quite rough (but sufficient for certain purposes such as searching for words).
Using the PDF.js demo page, I can make the underlying text visible by:
Deleting the
<canvas>
element.Disabling the
color: transparent
property on the.textLayer
class, which acts upon the underlying text.
... However, the text remains low-opacity, and I can't find the CSS that's controlling this effect (see below):
Before - with canvas
After - having applied the aforementioned two steps
Is there a way to manually restore the text back to full opacity using JavaScript? Or better yet, is there a special way to invoke PDF.js so that it presents just the underlying text, and discards the canvas entirely (or disables the canvas for all text usages)?