It was found that having pdfjs-dist in the dependencies is causing trouble when bundling the library for the browser.
It could be better to remove the loadAndExtractMarksFromDocument method, and leave it up for the used to load the document properly and then pass it to extractMarksFromDocument
I faced a problem In extracting marks from the PDF file which I will leave It below, It gave me null for all students' marks.
PDF file: Compiler_Project.pdf
JSON file I got after converting: Compiler_Project.txt
It's a problem related to the way of reading the PDF file and extracting the marks.