Hi Aspose Tech Support,
I am just wondering, how do you apply pdf encryption and/or privileges to an opened pdf file?
This is a simple code to convert doc to pdf , but I would like to apply privileges to the pdf file without closing the pdf file, could I do that?
Dim doc As Document = New Document(".\\Test.doc")
Dim stream As MemoryStream = New MemoryStream()
Dim xmlDoc As XmlDocument = New XmlDocument()
Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf()
pdf.IsImagesInXmlDeleteNeeded = True
pdf.IsTruetypeFontMapCached = True
pdf.TruetypeFontMapPath = Path.GetTempPath()
the pdf.kit example to apply encryption or privileges from the Aspose website is as follow,
Dim inFile As String = ".\\Test.pdf"
Dim outFile As String = ".\\Test_encrypted.pdf"
Dim fileSecurity As PdfFileSecurity = New PdfFileSecurity(inFile, outFile)
fileSecurity.EncryptFile("userpassword", "ownerpassword", PdfPrivilege.Copy Or PdfPrivilege.Print, False)
the problem is, there is additional process to create a new pdf file, I just want to avoid this process.