Randy Tang
Randy Tang

Reputation: 4363

Pdfjs: messy characters

I used pdfjs to display pdf files in browsers. However, some files just not display well. For example, all.pdf shows messy in pdfjs-all.html. But I used PdfShuffle to crop the first two page of all.pdf and save them to 2.pdf. Then it displays very well using pdfjs-2.html.

The only difference between pdfjs-all.html and pdfjs-2.html is the url. So, what's the problem? Is it because of the pdf file or the pdfjs?

Upvotes: 2

Views: 553

Answers (2)

juangnakarani
juangnakarani

Reputation: 1

I had a similar problem, and resolved it by setting textLayerMode: TEXT_LAYER_MODE, inside new PDFJS.PDFViewer({}).

The messy text is now gone and the pdf looks normal.

Upvotes: 0

shashanka n
shashanka n

Reputation: 2598

Have you tried encoding your URL and then inputting to the pdfjs algorithm?

Upvotes: 1

Related Questions