How to check the security of a pdf-file through vb.net?
Hello dear Adobe Support Community,
at the moment I'm working on a VB.NET project where I can merge several pdf-files to one pdf-file.
I'm using the Acrobat Library to accomplish this.
Now I have a problem with pdf-files which have security protections like read-only for example. Of course, this files can't be merged with the other files.
The idea is to have a For-Loop which checks every single pdf-file and returns an error message if the file is read-only.
My code looks something like this:
Dim appAcrobat As Acrobat.AcroApp
Dim apddSummary As Acrobat.AcroPDDoc ' This contains all single pdf-files in the end.'
Dim apddSingle As Acrobat.AcroPDDoc ' This contains a single pdf-file.'
Dim iNumPages As Integer
Dim iNumPagesSub As Integer
' At this point he should check the files. '
apddSummary.Open(Cstr(Me.ListBox1.Items(0)))
For Each strFound as String in Me.ListBox1.Items
If Me.ListBox1.Items.IndexOf(strFound) > 0 Then
iNumPages = apddSummary.GetNumPages()
apddSingle.Open(strFound)
iNumPagesSub = apddSingle.GetNumPages()
apddSummary.InsertPages(iNumPages -1, apddSingle, 0, iNumPagesSub, CInt(True))
apddSingle.Close()
' Where it gets saved, etc...'In the For-Loop I go through a ListBox where I previously inserted all the pdf-files I want to merge. But before the program starts to merge I want to check if all pdf-files which are inserted are not read-only and throw them out if they actually are read-only.
Is there any command or something I can work with in VB.NET?
Thanks for your help!
