I am trying to use the demo of your encrypt in an Access application but I do not manage to get the encrypted file,
Could you please tell me how to declare the veryEncryptPDF function correctly like in your examples for the Advanced PDF Tools,
https://www.verypdf.com/pdfinfoeditor/pdf-tools-sdk.html
Private Declare Function VeryPDF_PDFTools Lib "pdftoolsdk.dll" (ByVal strCommandLine As String) As Long
Or the COM version
Set PDFToolsCOM = CreateObject("PDFTools.PDFToolsCOM")
nRet = PDFToolsCOM.com_VeryPDF_PDFTools(strCmd)
Set PDFToolsCOM = Nothing
Thank you very much for your help!
===========================================
Pdftoolsdk is not good for PDF Encryption, we suggest you may download PDF Editor Toolkit Professional Version from following web page to try,
https://www.verypdf.com/pdfsdk/index.html#dl
https://www.verypdf.com/pdfsdk/pdf_editor_toolkit_pro_trial.zip
you can use PDF Editor Toolkit Pro SDK to encrypt your PDF file easily, pdf_editor_toolkit_pro_trial.zip contains more examples for PDF encryption, please refer to following sample code,
~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Declare Function VeryDecryptPDF Lib "verywrite.dll" (ByVal inFileName As String, ByVal outFileName As String, ByVal OwnerPassword As String, ByVal UserPassword As String) As Long Private Declare Function VeryIsPDFEncrypted Lib "verywrite.dll" (ByVal inFileName As String) As Long Private Declare Function VeryEncryptPDF Lib "verywrite.dll" (ByVal inFileName As String, ByVal outFileName As String, ByVal EnctyptLen As Long, ByVal permission As Long, ByVal OwnerPassword As String, ByVal UserPassword As String) As Long
Private Sub Command1_Click()
Dim result
result = VeryIsPDFEncrypted("test1.pdf")
If result = 0 Then
result = VeryEncryptPDF("test1.pdf", "test1Encrypt.pdf", 128, 4, "owner", "user")
result = VeryDecryptPDF("test1Encrypt.pdf", "test1Decrypt.pdf", "owner", "user")
End If
result = VeryIsPDFEncrypted("test2.pdf")
If result = 0 Then
result = VeryEncryptPDF("test2.pdf", "test2Encrypt.pdf", 40, 4, "owner", "user")
result = VeryDecryptPDF("test2Encrypt.pdf", "test2Decrypt.pdf", "owner", "user")
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~
You can also use COM interface to encrypt the PDF file,
~~~~~~~~~~~~~~~~~~~~~~~~~~
<%
dim pdfobj
dim very_ID
dim pdfFilePath
pdfFilePath = server.mappath(".") & "\"
Set pdfobj = Server.CreateObject("pdfshell.shellexe")
very_ID = pdfobj.com_veryEncryptPDF(pdfFilePath & "asp_TestEncrypt.pdf" ,pdfFilePath & "asp_TestEncrypt_Dis.pdf",128,4,"user","owner")
if very_ID < 0 then
Response.write "encrypt failed!"
Response.write very_ID
else
Response.write "encrypt success!"
end if
%>
~~~~~~~~~~~~~~~~~~~~~~~~~~
VeryPDF
========================================
cant I only use the "Encrypt PDF v 2.3 COM Component" because I do not need all the other functionality of the PDF Editor Toolkit?
==========================
Yes, if you need EncryptPDF functions only, you can use "Encrypt PDF v 2.3 COM Component", that's no problem.
VeryPDF
Fantastic! For those who are useless at checking for drivers by themselves, just like me, I found and installed everything I needed in no time at all with your kind share. My PC is now running perfectly without errors. Bookmarked it. Thank you!