How do I retrieve text from user selection in pdf.js?

前端 未结 2 1719
隐瞒了意图╮
隐瞒了意图╮ 2020-12-16 05:47

This question is specific to pdf.js, a javascript based pdf renderer. I\'m building a custom version where I need to extract the text that I select inside the pdf.

2条回答
  •  鱼传尺愫
    2020-12-16 06:23

    pdf.js has a file viewer.html inside the directory web.

    you have to do the following two steps in viwer.html

    1. Add Event Listener onselectionchange.
    2. Define the event handling function onselectionchange().
    
    

提交回复
热议问题