-
-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error during font loading: Failed to execute 'postMessage' on 'Worker': ArrayBuffer at index 0 is already detached #229
Comments
me too |
有什么解决办法吗。。不知道直接去用pdf.js行不行 感觉好麻烦 |
help |
same question,help |
我也遇到了 有解决吗 同学 |
遇到同样的问题,请问有解决办法吗? |
放弃了 改后端生成了 |
解决办法,拷贝cmap文件到本地,直接引用。 |
太棒了,这个办法,确实有用,非常感谢。 |
使用这种方式我的pdf文件中填充的内容完全无法显示,请问有没有什么解决办法 |
temporary fix :
|
原因其实是CMapReaderFactory 对象动态import语言文件的时候缓存了文件,导致第二次取缓存加载时出了问题,把CMapReaderFactory.js的代码改成这样就行了:
` |
好的,谢谢
…------------------ 原始邮件 ------------------
发件人: "FranckFreiburger/vue-pdf" <notifications@github.com>;
发送时间: 2020年11月1日(星期天) 凌晨0:34
收件人: "FranckFreiburger/vue-pdf"<vue-pdf@noreply.github.com>;
抄送: "不可思议"<1127850186@qq.com>;"Comment"<comment@noreply.github.com>;
主题: Re: [FranckFreiburger/vue-pdf] Error during font loading: Failed to execute 'postMessage' on 'Worker': ArrayBuffer at index 0 is already detached (#229)
原因其实是CMapReaderFactory 对象动态import语言文件的时候缓存了文件,导致第二次取缓存加载时出了问题,把CMapReaderFactory.js的代码改成这样就行了:
`
var bcmapName = './buffer-loader!pdfjs-dist/cmaps/'+query.name+'.bcmap';
return import(bcmapName).then(function(bcmap) {
//移除缓存的文件
delete require.cache[require.resolve(bcmapName)];
return { cMapData: bcmap.default, compressionType: CMapCompressionType.BINARY, }; });
`
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
搞出来了没 |
上面这个方法还没试,可以试试我们现在的解决方法: |
老哥,我纯属菜鸟阿,请问这个是在哪里加的呢,能不能吧完整的贴出来看一下逻辑。 |
vue-pdf下有一个CMapReaderFactory.js的文件啊,你就加一行代码就完了嘛,delete require.cache那行 |
Could the code following resolve the issue? |
不行呀 |
这样改也不行 |
在前一个组件 |
complete CMapReaderFactory.js file |
Hi, I am still facing this issue because I want to use vue-pdf with my cordova app on iOS and Android. Without When running on iOS, the first time PDF view works and font is displayed properly. but closing pdf file with pdfSrc.destroy() then the second time PDF file displayed without font and warning message "Warning: Error during font loading: The object can not be cloned." is output. Andoid is the same result but the message is slightly different. Adding "Warning: Error during font loading: Array.prototype.map callback must be a function" is output. and the PDF file displayed without font, it's failed to display font at first time. So it's worse. Does anyone know how to solve this issue for iOS/Android? |
I have fixed |
提示:Error during font loading: unexpected EOF in bcmap |
Is there any way not to modify dependent files? |
请问各位朋友一下,这个直接将cmap文件复制到本地不生效是什么原因呢? |
我也是复制到本地,然后通过相对路径引用没有效果,我能确定相对路径没有写错,请问你有找到是啥原因吗 |
@HuntTigerTonight 大神,用你删除缓存的方案解决生效了,nb |
import CMapReaderFactory from 'vue-pdf/src/CMapReaderFactory.js'
this.vuePdfSrc = pdf.createLoadingTask({url:src,CMapReaderFactory})
after use CMapReaderFactory ,First rendering of PDF file ,Fonts can be realistic.
But when I switch the URL of the PDF file, I call again
this.vuePdfSrc = pdf.createLoadingTask({url:src,CMapReaderFactory})
Console prompt
Warning: Error during font loading: Failed to execute 'postMessage' on 'Worker': ArrayBuffer at index 0 is already detached.
and Some fonts cannot be displayed.
Is there something wrong with the way I use it?
I need to toggle the PDF file on the same page
Thank you in advance for your answer
The text was updated successfully, but these errors were encountered: