You must Sign In to post a response.
  • Category: Windows 10

    VB.Net code to check if password is pdf protected

    Hi Team,

    I am new to VB.Net can you please help with the sample code to check if the pdf file is password protected. If it is password protected move the file to the backup folder.

    Thanks in Advance

    Pavan K
  • #770231
    Install Spire.PDF via NuGet. You'll be able to determine if a PDF document is password protected using the following sample code.

    Imports Spire.Pdf
    Imports System
    Namespace ProtectedOrNot
    Class Program
    Private Shared Sub Main(ByVal args() As String)
    Dim fileName As String = "Sample.pdf"
    Dim value As Boolean = PdfDocument.IsPasswordProtected(fileName)
    End Sub
    End Class
    End Namespace

  • Sign In to post your comments