PDFJS: Text layer rendering twice

有些话、适合烂在心里 提交于 2019-12-11 08:12:01

问题


Here's the context:

  • pdfjs-dist: v2.2.228
  • angualar/core: 8.2.0 (hybrid Env with an AngularJs 1.5.X)

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

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

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.

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?


回答1:


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: error on Text rendering for the PDF



来源:https://stackoverflow.com/questions/58770055/pdfjs-text-layer-rendering-twice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!