Skip to content
Advertisement

Tag: pdf.js

PDFJS cannot use a local worker file

I’m adding the workerSource pdfjsLib.GlobalWorkerOptions.workerSrc = ‘./pdf.worker.js’; but still showing this warning in the console Setting up fake worker. It works only when referencing the original file in github Answer I had the issue because I already had an instance of the pdfWorker created when the file pdf.worker.js was loaded, I fixed it by adding this globalThis.pdfjsWorker = null; just

How do I retrieve text from user selection in pdf.js?

This question is specific to pdf.js, a javascript based pdf renderer. I’m building a custom version where I need to extract the text that I select inside the pdf. There are other posts where you can fetch the text from one page or the whole pdf document such as the one here , but I’m looking to grab a specific

Prevent PDF auto download by idm using pdf.js

I’m using PDF.Js to embed PDF file for preview, and I removed the script of download and open files from the viewer.js , but when I test the page and PDF file try to show, the Internet Download Manager download it and abort the preview .. after search I found that using object instead of iframe may solve the problem,

Render PDF using PDF.JS and AngularJS from byte array

I’ve been following the following links to try to render a byte stream returned from an API to a PDF in browser using PDF.JS: http://codingcrazy87.blogspot.com/2014/05/view-pdf-files-directly-within-browser.html https://gist.github.com/fcingolani/3300351 Here is the JavaScript used to run render. Note: stream is a byte array returned from an API. Here is $scope.renderPDF: Here is the HTML in my template page: When the code runs I

How to print pdf.js document?

I’ve generated a document with pdf.js and it shows correctly. I’don’t have print button. How to add the button to allow users to print it ? I was using Chrome. Answer Try using the javascript-function window.print();, which opens the print-dialog. You will have to add an button to your html, which triggers the command – its not possible within the

Advertisement