I am trying to use pdf.js to display pdf files. I can already display pdf, but text selection is not enabled. Can someone give a small example of how to enable text selection in pdf.js?
I have already tried a few things, but without any success.
Currently my code is as follows:
PDFJS.getDocument('someRandom.pdf').then(function(pdf){ pdf.getPage(1).then(function(page) {
I also included this:
<script src="../pdfjs/pdf.js"></script> <script>PDFJS.workerSrc ="../pdfjs/pdf.worker.js"</script>
This example displays a PDF, but text selection is not enabled. I think that I really lack basic knowledge of pdf.js, but itβs hard to get a good example, since the documentation is not so good (at least for me).
I also tried this example here but the console throws an error and keeps saying new PDFJS.DefaultAnnotationsLayerFactory() - undefined.
source share