2

I am using the latest stable version of ngx-extended-pdf-viewer (4.1.2) and Angular 9.1. Everything work's great but after the application is built certain PDF-files don't show any text. It turns out that the reason was that the request for the .bcmap files fails.

Instead of requesting the bcmap files from: my-application/en/assets/cmaps/Adobe-CNS1-UCS2.bcmap

... the bcmap files are actually requested from: my-application/assets/cmaps/Adobe-CNS1-UCS2.bcmap

I don't understand that behaviour since the pdf.worker.min.js is correctly requested from my-application/en/assets/.

My angular.json assets setting looks like this:

"assets": [
   "src/favicon.ico",
   "src/assets",
   {
     "glob": "**/*",
     "input": "node_modules/ngx-extended-pdf-viewer/assets/",
     "output": "/assets/"
   }
]

Any tips what I am missing? Thanks in advance!

Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37
sevic
  • 879
  • 11
  • 36
  • 1
    Author of ngx-extended-pdf-viewer here. Like you, I'm a bit confused. I your bug still persists, drop me an email at webmaster1 at beyondjava.de. – Stephan Rauh Sep 30 '20 at 22:56

1 Answers1

3

You've found a bug. Either you update to version 5.0.1 (which fixes the bug). Or you use the default options for a workaround:

import { pdfDefaultOptions } from 'ngx-extended-pdf-viewer';
pdfDefaultOptions.cMapUrl = () => './' + pdfDefaultOptions.assetsFolder + '/cmaps/';
Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37