» ASP Sample Code: Encrypt PDF with ASP

                <% 
                
                Dim obj
                
                path = server.MapPath(".")
                
                Set obj = CreateObject("PDFEncryptX.EncryptLib")
                
                iRtn = obj.LoadFromFile("..\PDFEncryptX.pdf", "")
                
                obj.SetLicenseKey "Your code here"
                
                'Create Permissions: Can not to print, copy and edit.
                iPermissions = obj.CreatePermission(0, 0, 0, 1, 1, 1, 1, 1)
                
                'Call Encrypt() method
                iRtn = obj.Encrypt("..\PDFEncryptX_CanNot_Print_Copy_Edit.pdf", 2, iPermissions, "owner", "user")
                Response.Write "Encrypt() Return code:" & CLng(iRtn)
                
                set obj = Nothing
                
                %>