sandanat / vue-pdf-app

VUEjs v2 PDF viewer based on Mozilla's PDFJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Warning: Error during font loading: Unable to load binary CMap at: ../web/cmaps/Adobe-Japan1-UCS2.bcmap"

gouteru opened this issue · comments

commented

Configuration:

  • Web browser and it`s version: Chrome 91.0.4472.114
  • vue version: 2.6.14
  • vue-pdf-app version: 2.1.0

Steps to reproduce the problem:

I have implemented vue-pdf-app along with the readme.
Some of Japanese fonts is not displayed and the below console message is output.
"Warning: Error during font loading: Unable to load binary CMap at: ../web/cmaps/Adobe-Japan1-UCS2.bcmap"

What is the expected behavior?

CMap(bcmap files) directly path should be able to specified.

Related to mozilla/pdf.js#7696
Which version of Adobe-Japan1-UCS2.bcmap do you have?

commented

Which version of Adobe-Japan1-UCS2.bcmap do you have?

I don' t know the version of bcmap files.
I had not installed bcmap files. I had installed vue-pdf-app only.

Do I need to install other modules like pdfjs-dist separately to get bcmap files installed?
If so, how can I specify the url path of the bcmap files?

Provide a pdf file please

Do I need to install other modules like pdfjs-dist separately to get bcmap files installed?

No

commented

Here's the pdf file.
sample.pdf

Hello,

any updates for this issue? I have also the same problem.

经过查看源码后,可以通过覆盖方法的方式解决此问题

<VuePdfApp
  :pdf="pdfSrc"
  @after-created="afterCreatedHandler"
/>
export default {
  methods: {
    afterCreatedHandler(app) {
      const oldOpen = app.open.bind(app)
      app.open = function (file, args = {}) {
        return oldOpen(file, {
          ...args,
          cMapUrl: 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/',
          cMapPacked: true,
        })
      }
    }
  }
}

Instead of using the CDN link , I have downloaded the bcmap file in my local.
I need to use these downloaded bcmap files.