Hey,
I'm using PDFtk server for several tasks dealing with pdf files.
According to the manual and the examples - PDFtk Server Examples
there should be a way to decrypt pdf files.
Decrypt a PDF
There is also a possibility to merge 2 pdf files that one of the is encrypted
Join two files, one of which requires the password foopass. The output is not encrypted.
------------------------------------------------------------------------------------------------------------------------------------------
A.pdf is the encrypted file I want to decrypt
The password for A.pdf is abc123def
B.pdf should be the new file without encryption
I created the VBA below, however it doesn't work.
------------------------------------------------------------------------------------------------------------------------------------------
Sub Decrypt_Pdf()
Dim Wsh As Object 'WshShell
Set Wsh = CreateObject("WScript.Shell") 'New WshShell
Dim s As String
s = "cmd /c PDFtk " & "C:\Temp\A.pdf " & input_pw & "abc123def" & " output C:\Temp\B.pdf"
'Debug.Print 3, s
Wsh.Run s, 0, True
End Sub
I'm using PDFtk server for several tasks dealing with pdf files.
According to the manual and the examples - PDFtk Server Examples
there should be a way to decrypt pdf files.
Decrypt a PDF
pdftk secured.pdf input_pw foopass output unsecured.pdf
There is also a possibility to merge 2 pdf files that one of the is encrypted
Join two files, one of which requires the password foopass. The output is not encrypted.
pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf
------------------------------------------------------------------------------------------------------------------------------------------
A.pdf is the encrypted file I want to decrypt
The password for A.pdf is abc123def
B.pdf should be the new file without encryption
I created the VBA below, however it doesn't work.
------------------------------------------------------------------------------------------------------------------------------------------
Sub Decrypt_Pdf()
Dim Wsh As Object 'WshShell
Set Wsh = CreateObject("WScript.Shell") 'New WshShell
Dim s As String
s = "cmd /c PDFtk " & "C:\Temp\A.pdf " & input_pw & "abc123def" & " output C:\Temp\B.pdf"
'Debug.Print 3, s
Wsh.Run s, 0, True
End Sub