4 ms·
Minor performance tip: you can disable the creation of DOM elements backing text and whatnot in PDF.js; this allows for faster rendering on some browsers. You
by angersock 13y ago
Minor performance tip: you can disable the creation of DOM elements backing text and whatnot in PDF.js; this allows for faster rendering on some browsers.
You lose easy search, but it can make your life a lot easier if you don't need them.
- windsurfer 13y agoYou also lose text select (and thus copy+paste)
- enlashok 13y agoBut you can approximately restore that if you use Project Naptha as well... urgh... please nobody do this.
- sp332 13y agoIs it easy to do that?
- angersock 13y agoMemory suggests yes (I think it's just a render param you pass in or something?) but I'll need to check old code tonight to give you a definitive answer.
- async5 13y agoYes, you can build you own personalized extension for Firefox, Chrome or Opera from PDF.js source code, which will disable text layer. (see also #textLayer=off feature at https://github.com/mozilla/pdf.js/wiki/Debugging-pdf.js#url-parameters https://github.com/mozilla/pdf.js/wiki/Debugging-pdf.js#url-...)
- bthorben 13y agoWe realize that the text layer is sometimes a performance problem. We pushed already a lot of improvements to it and there is more too come.
- angersock 13y agoNot your all's fault...the nature of the beast is that a PDF, in the pathological case, could result in thousands and thousands of individually-styled DOM elements per page, right? Not much to be done in that case.