easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

IsEncrypted Method

Checks if a PDF file is encrypted.

Function IsEncrypted() As Boolean

bool IsEncrypted()

boolean IsEncrypted() throws PDFProcessorException

Return Values

True if the given PDF file is encrypted; False otherwise.


Note that if a file is password protected, you cannot even open it without knowing the password.

Therefore you should consider using PDFProcessor.IsEncrypted instead. PDFProcessorHandle.IsEncrypted should only be used when a PDF file is already open.

Example Usage

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
Set oProcessorHandle = oProcessor.OpenFile("C:\test\input.pdf", "C:\test\input.pdf")
isEncrypted = oProcessorHandle.IsEncrypted()
If isEncrypted Then
    MsgBox "This file is Encrypted."
End If