PdfFileSecurity.ChangePassword

ChangePassword(string, string, string)

تغير كلمة مرور المستخدم وكلمة مرور المالك مع الحفاظ على إعدادات الأمان الأصلية. يمكن أن تكون كلمة مرور المستخدم الجديدة وكلمة مرور المالك الجديدة فارغة أو null. سيتم استبدال كلمة مرور المالك بسلسلة عشوائية إذا كانت كلمة مرور المالك الجديدة فارغة أو null. يتم إلقاء استثناء إذا فشل العملية.

public bool ChangePassword(string ownerPassword, string newUserPassword, string newOwnerPassword)
ParameterTypeDescription
ownerPasswordStringكلمة مرور المالك الأصلية.
newUserPasswordStringكلمة مرور المستخدم الجديدة.
newOwnerPasswordStringكلمة مرور المالك الجديدة.

Return Value

True للنجاح.

Examples

[C#]
 string inFile = "D:\\input.pdf"; //The TestPath may be re-assigned.
 string outFile = "D:\\output.pdf";	//The TestPath may be re-assigned.
 PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);		
 fileSecurity.ChangePassword("owner","newuser","newowner");

[Visual Basic]
 Dim inFile As String = ".D:\\input.pdf"  'The TestPath may be re-assigned.'
 Dim outFile As String = "D:\\output.pdf"  'The TestPath may be re-assigned.'
 Dim fileSecurity As PdfFileSecurity = New PdfFileSecurity(inFile,outFile) 
 fileSecurity.ChangePassword("owner","newuser","newowner")	

See Also


ChangePassword(string, string, string, DocumentPrivilege, KeySize)

تغير كلمة مرور المستخدم وكلمة المرور بواسطة كلمة مرور المالك، ويسمح بإعادة تعيين أمان مستند Pdf. يمكن أن تكون كلمة مرور المستخدم الجديدة وكلمة مرور المالك الجديدة فارغة أو null. سيتم استبدال كلمة مرور المالك بسلسلة عشوائية إذا كانت كلمة مرور المالك الجديدة فارغة أو null. يتم إلقاء استثناء إذا فشل العملية.

public bool ChangePassword(string ownerPassword, string newUserPassword, string newOwnerPassword, 
    DocumentPrivilege privilege, KeySize keySize)
ParameterTypeDescription
ownerPasswordStringكلمة مرور المالك الأصلية.
newUserPasswordStringكلمة مرور المستخدم الجديدة.
newOwnerPasswordStringكلمة مرور المالك الجديدة.
privilegeDocumentPrivilegeإعادة تعيين الأمان.
keySizeKeySizeKeySize.x40 لتشفير 40 بت، KeySize.x128 لتشفير 128 بت و KeySize.x256 لتشفير 256 بت.

Return Value

True للنجاح.

Examples

[C#]
string inFile = ".D:\\input.pdf"; //The TestPath may be re-assigned.
string outFile = "D:\\output.pdf";	//The TestPath may be re-assigned.
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);	
fileSecurity.ChangePassword("owner","newuser","newowner", DocumentPrivilege.Print,KeySize.x256);

[Visual Basic] 
Dim inFile As String =  ".D:\\input.pdf"  'The TestPath may be re-assigned.'
Dim outFile As String =  "D:\\output.pdf"  'The TestPath may be re-assigned.'
Dim fileSecurity As PdfFileSecurity =  New PdfFileSecurity(inFile,outFile) 
fileSecurity.ChangePassword("owner","newuser","newowner", DocumentPrivilege.Print,KeySize.x256)

See Also


ChangePassword(string, string, string, DocumentPrivilege, KeySize, Algorithm)

تغير كلمة مرور المستخدم وكلمة المرور بواسطة كلمة مرور المالك، ويسمح بإعادة تعيين أمان مستند Pdf. يمكن أن تكون كلمة مرور المستخدم الجديدة وكلمة مرور المالك الجديدة فارغة أو null. سيتم استبدال كلمة مرور المالك بسلسلة عشوائية إذا كانت كلمة مرور المالك الجديدة فارغة أو null. هناك 6 تركيبات ممكنة من قيم KeySize و Algorithm. ومع ذلك، فإن (KeySize.x40، Algorithm.AES) و (KeySize.x256، Algorithm.RC4) غير صالحة وسيتم إلقاء استثناء إذا واجهت المجموعة هذا. يتم إلقاء استثناء إذا فشل العملية.

public bool ChangePassword(string ownerPassword, string newUserPassword, string newOwnerPassword, 
    DocumentPrivilege privilege, KeySize keySize, Algorithm cipher)
ParameterTypeDescription
ownerPasswordStringكلمة مرور المالك الأصلية.
newUserPasswordStringكلمة مرور المستخدم الجديدة.
newOwnerPasswordStringكلمة مرور المالك الجديدة.
privilegeDocumentPrivilegeإعادة تعيين الأمان.
keySizeKeySizeKeySize.x40 لتشفير 40 بت، KeySize.x128 لتشفير 128 بت و KeySize.x256 لتشفير 256 بت.
cipherAlgorithmAlgorithm.AES للتشفير باستخدام خوارزمية AES أو Algorithm.RC4 لتشفير RC4.

Return Value

True للنجاح.

Examples

[C#]
string inFile = ".D:\\input.pdf"; //The TestPath may be re-assigned.
string outFile = "D:\\output.pdf";	//The TestPath may be re-assigned.
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);	
fileSecurity.ChangePassword("owner","newuser","newowner", DocumentPrivilege.Print,KeySize.x256,Algorithm.AES);

[Visual Basic] 
Dim inFile As String =  ".D:\\input.pdf"  'The TestPath may be re-assigned.'
Dim outFile As String =  "D:\\output.pdf"  'The TestPath may be re-assigned.'
Dim fileSecurity As PdfFileSecurity =  New PdfFileSecurity(inFile,outFile) 
fileSecurity.ChangePassword("owner","newuser","newowner", DocumentPrivilege.Print,KeySize.x256,Algorithm.AES)

See Also