Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Nov 08, 2018 3:09 pm

Hi there,

I apologize if this information is out there already, but I could not find it clearly marked in the API. I am considering purchasing Spire for one of my clients to leverage the ability to adjust the PDF permissions for content copying. I downloaded the trial and was able to demonstrate this successfully, but Visual Studio and the API documentation inform me that these features are deprecated.

Is there any alternative that is still supported? I would like to purchase Spire for this use case but I need confidence that this feature will not go away in the future.

Thanks,
Matt

matthew.burke
 
Posts: 1
Joined: Thu Nov 08, 2018 2:19 pm

Fri Nov 09, 2018 1:59 am

Dear Matt,

Thank you for your inquiry.
The method has been deprecated, please use the "Encrypt" method instead.
Below is the sample code for your kind reference.
Code: Select all
PdfEncryptionKeySize keySize = PdfEncryptionKeySize.Key128Bit;
string openPassword = "e-iceblue";
string permissionPassword = "test";
PdfPermissionsFlags flags = PdfPermissionsFlags.Print | PdfPermissionsFlags.FillFields;
pdf.Security.Encrypt(openPassword, permissionPassword, flags, keySize);


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Nov 12, 2018 8:01 am

Dear Matt,

Greetings from e-iceblue!
Has your issue been resolved? Your feedback would be greatly appreciated!

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Apr 28, 2021 6:51 pm

What is the best way to handle Getting SecurityPermissions, now that it is obsolete?

Code: Select all
var permissionString = pdfDoc.Security.Permissions.ToString();

var permissions = permissionString.Split(',');

var hasEditContentPermission = permissions.Contains("EditContent");
var hasDefaultPermission = permissions.Contains("Default");

if (hasDefaultPermission == false && hasEditContentPermission == false)
{
   locked = true;
}


terrence@mactexas.com
 
Posts: 95
Joined: Tue May 19, 2015 8:09 pm

Thu Apr 29, 2021 3:53 am

Hello,

Thanks for your inquiry.
This "set" method of “Security.Permissions” may be removed in the future, but the "get" method still works. You can continue to use this code.
If there are any other questions related to our products, just feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Thu Apr 29, 2021 1:54 pm

Our team is moving towards changing Visual Studio build / error / warning behavior.

We want to treat all Warnings as Errors.

The warning "PdfSecurity.Permissions is obsolete" causes a build failure.

Is there another method that does the same thing as I posted above that is not obsolete?

Thank you.

terrence@mactexas.com
 
Posts: 95
Joined: Tue May 19, 2015 8:09 pm

Fri Apr 30, 2021 5:46 am

Hello,

Thanks for your response.
For your requirements, I discussed with our Dev team and they plan to readjust this method. If the adjustment is completed, we will inform you immediately. Apologize for the inconvenience caused.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri May 21, 2021 3:16 am

Hello,

Greetings from E-iceblue!
Glad to inform you that we just released Spire.PDF Pack(Hot Fix) Version:7.5.7 which adjusted the method of "PdfSecurity.Permissions", please download it from the following links to test on your side. Looking forward to your test result.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.PDF/7.5.7

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed May 26, 2021 10:38 am

Hello,

Greetings from E-iceblue!
How is your issue now? Does this hotfix solve your issue? Any feedback will be greatly appreciated.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF

cron