sandanat / vue-pdf-app

VUEjs v2 PDF viewer based on Mozilla's PDFJS
MIT License
219 stars 99 forks source link

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

Open gouteru opened 3 years ago

gouteru commented 3 years ago

Configuration:

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.

sandanat commented 3 years ago

Related to https://github.com/mozilla/pdf.js/issues/7696 Which version of Adobe-Japan1-UCS2.bcmap do you have?

gouteru commented 3 years ago

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?

sandanat commented 3 years ago

Provide a pdf file please

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

No

gouteru commented 3 years ago

Here's the pdf file. sample.pdf

nisaDoc commented 1 year ago

Hello,

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

github-lxb commented 1 year ago

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

<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,
        })
      }
    }
  }
}
kamalakanthgr commented 10 months ago

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