Is there a minimalistic PDF.js sample that supports text selection?

后端 未结 3 1142
闹比i
闹比i 2020-12-12 17:28

I\'m trying PDF.js.

My problem is that the Hello World demo does not support text selection. It will draw everything in a canvas without the text layer. The official

3条回答
  •  伪装坚强ぢ
    2020-12-12 17:57

    If you want to render all pages of pdf document in different pages with text selection you can use either

    1. pdf viewer
    2. canvas and renderer to parse the text and append it over the canvas, so that it looks like text selection.

    But on real scenario, if you are going to process with the canvas like zoom in/out then this canvas operation will terribly reduce your browser performance. please check the below url,

    http://learnnewhere.unaux.com/pdfViewer/viewer.html

    You could get the complete code from here https://github.com/learnnewhere/simpleChatApp/tree/master/pdfViewer

提交回复
热议问题