问题
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