Skip to main content
Known Participant
June 30, 2022
Question

is there any event for prevent user from right click or copy text using adobe embed api

  • June 30, 2022
  • 1 reply
  • 1351 views

I'm stuck in a situation i want to prevent user from copying text. Can i prevent user from right click and copy text using ctrl + c. I know there must be a solutoin to that but i didn;t find anything yet. 

 

i was using this : 
document.addEventListener('keyup', event => console.log(event.code == "c"));
document.addEventListener('contextmenu', event => event.preventDefault());

but it didn't work as i guess pdf is rendered inside the iframe .

    This topic has been closed for replies.

    1 reply

    Raymond Camden
    Community Manager
    Community Manager
    June 30, 2022

    Can I ask why? 🙂 Keep in mind a user will be able to download the PDF and copy the text that way. 

     

    I can say that Embed will respect those restrictions. I was able to set a PDF such that copying was not allowed. When viewed in Embed, while I could select text, hitting CTRL+C did NOT copy the text to clipboard. 

    Known Participant
    July 1, 2022

    yes this is what i want to do. i want user to select the text , highlight it but should not be able to copy. either using ctrl+c or by right click and copy . how can i stop user from doing this , 

    Raymond Camden
    Community Manager
    Community Manager
    July 3, 2022

    You set the permissions in the PDF, using an app like Acrobat, after it's created and before you serve it, and then the online service respects it.


    As Test Screen Name said. If you think about it, if it was done in Embed, someone could use devtools to simply remove that block.