PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Fri May 16, 2025 5:22 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Dec 16, 2024 10:44 am 
Offline

Joined: Mon Dec 16, 2024 10:39 am
Posts: 1
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?


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 19, 2024 2:37 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3128
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 29, 2025 1:13 pm 
Offline
empira Employee

Joined: Tue Sep 15, 2020 10:34 am
Posts: 2
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group