PDFJS:两次渲染文本层 [英] PDFJS: Text layer rendering twice

查看:542
本文介绍了PDFJS:两次渲染文本层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是上下文:

  • pdfjs-dist:v2.2.228
  • angualar/core:8.2.0(带有AngularJs 1.5.X的混合Env)

目标:将pdfjs-dist升级到最新版本(2.3.200或至少2.2.X)

Objective: to upgrade pdfjs-dist to the latest versions (2.3.200 or at least 2.2.X)

我从pdfjs-dist 2.0.4xx升级了,以下是正在渲染的内容:

I upgraded from pdfjs-dist 2.0.4xx, and here's what is being rendered:

因此,基本上,不是像使用可突出显示的文本那样正确显示PDF那样,而是重复了文本:一个文本版本正确(以图形方式呈现),另一版本似乎可以正常显示文本选择和搜索.

So basically, instead of having the PDF rendered correctly, with highlightable text and so on, there's like a duplicate of the text: one version of the text is rendered correctly (graphically), the other version seems to work OK for text selection and searching.

进行任何搜索时,PDFFindController都在高亮显示的层上工作(如您所看到的区域在图像的上部带有绿色的文字).

When doing any search, PDFFindController works on the highlightable layer (as you can see the area with the greenish text in the upper part of the image).

您知道什么可能导致此行为吗?

Any idea what might cause this behavior?

推荐答案

这是由于PDFjs的新更新需要css文件来设置pdf样式.

this is due to the new update of PDFjs requires css file to style the pdf.

您可以从以下问题的答案中获得更多详细信息

you can get more details on this from the following question's answer

PDFJS:PDF文本呈现错误

这篇关于PDFJS:两次渲染文本层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆