Skip to content

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Jun 9, 2021

In v2.5.207 pdf.js added the "enablePermissions" option to disable copying in the viewer for the PDF files that specify it. The option is off by default, so it needs to be explicitly enabled.

Note that the content copy is prevented just by disabling selection through CSS. The "selection disabled" flag in a PDF document is not a strong security measure and can be easily circumvented (for example, just downloading the file and opening it in a PDF reader that does not honour the flag), so disabling the selection through CSS was deemed good enough for pdf.js.

How to test

Result with this pull request

The text can not be selected

Result without this pull request

The text can be selected

In v2.5.207 pdf.js added the "enablePermissions" option to disable
copying in the viewer for the PDF files that specify it. The option is
off by default, so it needs to be explicitly enabled.

Note that the content copy is prevented just by disabling selection
through CSS. The "selection disabled" flag in a PDF document is not a
strong security measure and can be easily circumvented (for example,
just downloading the file and opening it in a PDF reader that does not
honour the flag), so disabling the selection through CSS was deemed good
enough for pdf.js.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@danxuliu
Copy link
Member Author

danxuliu commented Jun 9, 2021

/backport to stable21

@danxuliu
Copy link
Member Author

danxuliu commented Jun 9, 2021

/backport to stable20

@danxuliu
Copy link
Member Author

danxuliu commented Jun 9, 2021

/backport to stable19

@backportbot-nextcloud
Copy link

The backport to stable19 failed. Please do this backport manually.

@danxuliu
Copy link
Member Author

Not backported to stable19 as the feature was introduced in pdf.js 2.5.207 but stable19 only has pdf.js 2.1.266.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants