GdPicture.NET Reference Guide
PdfGetEncryptionScheme Method (GdViewer)
Example 





GdPicture14.WPF Namespace > GdViewer Class : PdfGetEncryptionScheme Method
Returns the encryption algorithm which has been used to encrypt the currently displayed PDF document. If the document currently displayed in the GdViewer control is not the PDF file, the method will fail.
Syntax
'Declaration
 
Public Function PdfGetEncryptionScheme() As PdfEncryption
public PdfEncryption PdfGetEncryptionScheme()
public function PdfGetEncryptionScheme(): PdfEncryption; 
public function PdfGetEncryptionScheme() : PdfEncryption;
public: PdfEncryption PdfGetEncryptionScheme(); 
public:
PdfEncryption PdfGetEncryptionScheme(); 

Return Value

A member of the PdfEncryption enumeration. Please always use the GetStat method to determine if this method has been successful.
Remarks
We strongly recommend using the GetStat method to identify the specific reason for the method's failure. Be aware that this method is only meaningful for PDF documents, otherwise the method will fail.
Example
How to retrieve the encryption algorithm that has been used to encrypt the displayed PDF document.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    Dim message As String = "The current file is: " + GdViewer1.GetLastPath()
    If GdViewer1.GetDocumentType() = DocumentType.DocumentTypePDF Then
        message += vbCrLf + "Author: " + GdViewer1.PdfGetAuthor() +
                   vbCrLf + "Title: " + GdViewer1.PdfGetTitle() +
                   vbCrLf + "PDF Version: " + GdViewer1.PdfGetVersion()
                   vbCrLf + "Encryption Scheme: " + GdViewer1.PdfGetEncryptionScheme() +
    Else
        message += vbCrLf + "This file is not a PDF document, its format is: " + GdViewer1.GetDocumentType().ToString()
    End If
    MessageBox.Show(message, "GdViewer.PdfGetEncryptionScheme")
Else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.PdfGetEncryptionScheme")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    string message = "The current file is: " + GdViewer1.GetLastPath();
    if (GdViewer1.GetDocumentType() == DocumentType.DocumentTypePDF)
    {
        message += "\nAuthor: " + GdViewer1.PdfGetAuthor() +
                   "\nTitle: " + GdViewer1.PdfGetTitle() +
                   "\nPDF Version: " + GdViewer1.PdfGetVersion() +
                   "\nEncryption Scheme: " + GdViewer1.PdfGetEncryptionScheme() +
    }
    else
    {
        message += "\nThis file is not a PDF document, its format is: " + GdViewer1.GetDocumentType().ToString();
    }
    MessageBox.Show(message, "GdViewer.PdfGetEncryptionScheme");
}
else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.PdfGetEncryptionScheme");
See Also

Reference

GdViewer Class
GdViewer Members
GetLastPath Method
GetDocumentType Method
PdfGetVersion Method
PdfGetTitle Method
PdfGetAuthor Method