react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Enable to copy selected text and replace the default context menu with custom one

Open krishnaacharyaa opened this issue 5 months ago • 1 comments

Before you start - checklist

  • [X] I followed instructions in documentation written for my React-PDF version
  • [X] I have checked if this bug is not already reported
  • [X] I have checked if an issue is not listed in Known issues
  • [X] If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo

Description

Hi @wojtekmaj Is there any way that i can set the selected data from the pdf in a state variable and give a context menu to "Add to Notes",

Basically clicking on the "Add to notes" in the custom context menu should give me the selected text in a state variable.

Basically 2 parts

  1. copy selected text
  2. customize the context menu with a Add to notes icon

image The above is the present context menu i.e default context menu...

Can you kindly let me know if it is possible, or ways to make it possible

Steps to reproduce

After the pdf is render Select the text context menu will open

Expected behavior

I expect custom context menu

Actual behavior

Presently it has Default context menu

Additional information

No response

Environment

  • **Browser **: edge
  • React-PDF version: 7.7.0
  • Nextjs version: 14.1.0
  • Webpack version (if applicable):

krishnaacharyaa avatar Feb 06 '24 08:02 krishnaacharyaa