I am creating an application that displays a PDF file among others. I need to implement a search function so that I can search for conditions in a pdf file. To display the file, I use PDFJS.
The pdfjs library provides some examples, including an example of components that displays the page, and you can mark the text ( https://github.com/mozilla/pdf.js/tree/master/examples/components ).
But when I try to use this code in my application, I get the error PDFJS.DefaultTextLayerFactory() undefined. I include these three files:
<script src="lib/pdfviewer/pdf.js"></script> <script src="lib/pdfviewer/pdf.worker.js"></script> <script src="lib/pdfviewer/pdf_viewer.js"></script> <script src="lib/pdfviewer/compatibility.js"></script>
What am I doing wrong? Why doesn't DefaultTextLayerFactory know DefaultTextLayerFactory ?
source share