How to get selected text from PDF opened in Chrome Browser from an extension

Vaso Beruashvili picture Vaso Beruashvili · Sep 1, 2016 · Viewed 14.7k times · Source

I have PDF opened in Chrome's new tab and want to copy text. Is there any solution to do this?

Answer

freb picture freb · Feb 1, 2018

I just ran into this, but it wasn't an issue with Chrome. PDF files allow you to implement some password protected features, such as limiting the ability to copy and paste the content. You can see what these permissions are by opening the file in Adobe Acrobat Reader, and selecting file -> properties -> Security. (Chrome's PDF viewer is pretty bare-bones, so I don't know any way to view the permissions with Chrome). But Chrome does enforce the security placed on PDF files.

Fortunately, it is pretty easy to remove password protection from a PDF file. Googling it will provide some online resources that will do it. If you want to do it yourself, here is one option (probably only for advanced users): https://github.com/hhrutter/pdfcpu