Document.Encrypt

Encrypt(string, string, DocumentPrivilege, CryptoAlgorithm, bool)

تشفر الوثيقة. اتصل بعد ذلك بـ Save للحصول على النسخة المشفرة من الوثيقة.

public void Encrypt(string userPassword, string ownerPassword, DocumentPrivilege privileges, 
    CryptoAlgorithm cryptoAlgorithm, bool usePdf20)
ParameterTypeDescription
userPasswordStringكلمة مرور المستخدم.
ownerPasswordStringكلمة مرور المالك.
privilegesDocumentPrivilegeأذونات الوثيقة، انظر Permissions لمزيد من التفاصيل.
cryptoAlgorithmCryptoAlgorithmالخوارزمية التشفيرية، انظر CryptoAlgorithm لمزيد من التفاصيل.
usePdf20Booleanدعم للإصدار 6 (الامتداد 8).

Examples

المثال التالي يوضح كيفية تشفير ملفات PDF باستخدام DocumentPrivilege

[C#]

	// The path to your PDF File.
	string pdfFilePath = "YOUR_PDF_FILE_PATH";

	// Open document
	using (Document document = new Document(pdfFilePath))
	{
	// Encrypt PDF
	document.Encrypt("YOUR_USER_PASSWORD", "YOUR_OWNER_PASSWORD", DocumentPrivilege.AllowAll, CryptoAlgorithm.RC4x128, true);

	// Save updated PDF
	document.Save(pdfFilePath);
	}
[VB.NET]

    ' The path to your PDF File.
    Dim pdfFilePath As String = "YOUR_PDF_FILE_PATH"
    
	' Open document
    Using document As Document = New Document(pdfFilePath)
        ' Encrypt PDF
        document.Encrypt("YOUR_USER_PASSWORD", "YOUR_OWNER_PASSWORD", DocumentPrivilege.AllowAll, CryptoAlgorithm.RC4x128, True)
        ' Save updated PDF
        document.Save(pdfFilePath)
    End Using

See Also


Encrypt(string, string, Permissions, CryptoAlgorithm)

تشفر الوثيقة. اتصل بعد ذلك بـ Save للحصول على النسخة المشفرة من الوثيقة.

public void Encrypt(string userPassword, string ownerPassword, Permissions permissions, 
    CryptoAlgorithm cryptoAlgorithm)
ParameterTypeDescription
userPasswordStringكلمة مرور المستخدم.
ownerPasswordStringكلمة مرور المالك.
permissionsPermissionsأذونات الوثيقة، انظر Permissions لمزيد من التفاصيل.
cryptoAlgorithmCryptoAlgorithmالخوارزمية التشفيرية، انظر CryptoAlgorithm لمزيد من التفاصيل.

See Also


Encrypt(string, string, Permissions, CryptoAlgorithm, bool)

تشفر الوثيقة. اتصل بعد ذلك بـ Save للحصول على النسخة المشفرة من الوثيقة.

public void Encrypt(string userPassword, string ownerPassword, Permissions permissions, 
    CryptoAlgorithm cryptoAlgorithm, bool usePdf20)
ParameterTypeDescription
userPasswordStringكلمة مرور المستخدم.
ownerPasswordStringكلمة مرور المالك.
permissionsPermissionsأذونات الوثيقة، انظر Permissions لمزيد من التفاصيل.
cryptoAlgorithmCryptoAlgorithmالخوارزمية التشفيرية، انظر CryptoAlgorithm لمزيد من التفاصيل.
usePdf20Booleanدعم للإصدار 6 (الامتداد 8).

See Also