Hide/Disable download button on Chrome PDF Viewer

前端 未结 3 1263
遇见更好的自我
遇见更好的自我 2021-01-15 04:30

I\'m looking for a way to hide or disable the download button that appears in the Chrome PDF viewer. I have disabled the print button using the protection script of fpdf(htt

3条回答
  •  孤街浪徒
    2021-01-15 05:23

    If it's only for not so tech-saavy users, you can disable download in the chrome pdf viewer by generating one-time usable unique urls eg. with a query string parameter that is stored on server and allowed to be used only once. The download button does download a second time and will fail in this case. This is however an implementation detail in the chrome pdf viewer that might change. If the user does not have a pdf viewer in the browser or it is disabled, the file will simply download by default.

    You might want to try pdf.js, that will render and not download in any browser, but tech-saavy users will still be able to get the document. It is probably also less performant than the chrome pdf viewer.

    If you turn the content into images, users can still take the batch of images and combine them into a pdf, however in this case the text is harder to recover, but still possible with OCR.

    If you want to make it harder to copy the content or just detect it, you could also use watermarks in your downloaded images or incorporate steganography to identify the user who made the copy based on the released file found in the wild. Be aware that watermarks can always be removed, usually very easily from PDF files and it is a bit harder but still possible to remove from images. Carefully designed hidden identifiers (steganography) can also be removed but it has to be found first and usually users don't look when a document is not obviously stamped.

提交回复
热议问题