PDFsharp & MigraDoc Forum https://forum.pdfsharp.net/ |
|
Access to SecuritySettings.HasOwnerPermissions not possible https://forum.pdfsharp.net/viewtopic.php?f=2&t=4746 |
Page 1 of 1 |
Author: | delphibase [ Mon Dec 16, 2024 10:44 am ] |
Post subject: | Access to SecuritySettings.HasOwnerPermissions not possible |
Hello, i'm using PDFsharp 6.1.1 as nuget package in my c# projekt. I try to access to the property value of PdfDocument.SecuritySettings.HasOwnerPermissions. But this is not possible, because the getter is marked as internal. How can i check if a pdf dokument is unprotected oder even opened by using the passwort? |
Author: | Thomas Hoevel [ Thu Dec 19, 2024 2:37 pm ] |
Post subject: | Re: Access to SecuritySettings.HasOwnerPermissions not possi |
delphibase wrote: How can i check if a pdf dokument is unprotected oder even opened by using the passwort? We'll think about it, but answer will come after the holiday season.
|
Author: | Martin Ossendorf [ Wed Jan 29, 2025 1:13 pm ] |
Post subject: | Re: Access to SecuritySettings.HasOwnerPermissions not possi |
We’re sorry, but currently it’s probably not possible to determine if a document was opened unprotected or by using a user or owner password. However, PdfDocument.SecuritySettings.HasOwnerPermissions just gets the current permissions, which doesn’t answer your question. So, making it public probably wouldn’t solve your problem: If the document is unprotected, it returns true as you have of course all permissions like the owner has. Same, if the document is protected with a user password only and opened by this (see below). It only returns false, if the document is protected with a user and an owner password and opened with the user password. So, to answer your question for a document, a new property would have to be implemented. And it has to be discussed if it gives also information about if a user or owner password was used. The latter could be confusing, as for a document created with a user password only, it would probably be opened with an owner password actually. This is because on document creation the user password should also be saved as the owner password if only a user password was given, as without actively setting an owner password you would expect the user to have owner rights as well. So, there are some questions left, and we sadly won’t add this feature in our current development for PDFsharp 6.2.0, but maybe in the following previews. Feel free to concretize your needs. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |