ng2-pdfjs-viewer icon indicating copy to clipboard operation
ng2-pdfjs-viewer copied to clipboard

using minified files

Open robertomorati opened this issue 3 years ago • 3 comments

Hi @petebacondarwin and @anthonybriand!

I hope everything is going well with you!

Please, could you clarify the following doubt (?):

Best regards

robertomorati avatar May 11 '21 00:05 robertomorati

I'm not sure why you linked me into this issue?

petebacondarwin avatar May 11 '21 10:05 petebacondarwin

I'm not sure why you linked me into this issue?

Hi @petebacondarwin! Sorry! I marked you because GitHub showed your username. I thought you were a contributor to the project.

robertomorati avatar May 11 '21 12:05 robertomorati

Instead of using the provided file, try the below:

Copy the node_modules\ng2-pdfjs-viewer\pdfjs to a place like assets\pdfjs (Already assets folder and no need to config angular.json)

Edit the assets\pdfjs\web\view.html file to use the *.min.js (or replace with some CDN?) image

Edit assets\pdfjs\web\viewer.min.js value:"../build/pdf.worker.js" with ../build/pdf.worker.min.js of course And, require("../build/pdf.js")

Delete extra files

  • assets\pdfjs\build, only keep *.min.js
  • assets\pdfjs\web, only keep *.min.js (viewer.min.js)
  • assets\pdfjs\web\locale, can keep locale.properties and en-US

This should reduce the build/load significantly: image

YipingRuan avatar Oct 21 '21 06:10 YipingRuan