Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
meghadwivedi@adobeforums.com #1
Need javascript/VB code to open passwordprotected PDF file by passing password in codeitself.
Hi,
I have used PDFcreator to create the PDF file with password security
'To create PDF file with password security
With PDFCreator1
..cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
' ==============
.cOption("AutosaveDirectory") = strBackupPath '& "\" & Format(Trim(Sheets("Form16_Database").Range("A" &
I).Value), "0#####") & "\" 'ActiveWorkbook.Path
Debug.Print Trim(Sheets("Form16_Database").Range("A" & I).Value) & "Form16-" & Format(Trim(Sheets
("Form16_Database").Range("A" & I).Value), "0#####") & "-" & Format(Now(), "YYYYMMDDHHMMSS") & ".PDF"
.cOption("AutosaveFilename") = Format(Trim(Sheets("Form16_Database").Range("B" & I).Value), "0#####") & ".PDF"
FileName = Format(Trim(Sheets("Form16_Database").Range("B" & I).Value), "0#####") & ".PDF"
.cOption("AutosaveFormat") = 0
.cOptions.PDFUseSecurity = 1
.cOption("PDFOwnerPass") = 1
.cOption("PDFOwnerPasswordString") = "mypass"
.cOption("PDFUserPass") = 1
.cOption("PDFUserPasswordString") = "mypass"
..cClearCache
End With
'Printing to PDF Creator
ActiveSheet.PrintOut Copies:=1, ActivePrinter:="PDFCreator"
'Making the system wait for the PDF creator to create the file
Do Until PDFCreator1.cCountOfPrintjobs = 1
DoEvents
Sleep 1000
Loop
PDFCreator1.cPrinterStop = False
Sleep 1000
''and To fix digital signature used below code from Acrobat SDK 8.1..
''VB code for fixing Digital Signature --calling jaascript file from SDK.
Sub GetDigitalSignature(PDFFilepath As String, PDFFileName As String, PFXfile As String, Password As String, Top As Double,
Left As Integer)
Dim gapp As Acrobat.AcroApp
Dim gpddoc As Acrobat.AcroPDDoc
Dim jso As Object
Dim FullPath As String
Dim avDoc As CAcroAVDoc
Dim boK As Boolean
Dim ppklite As Object
Set avDoc = CreateObject("AcroExch.AVDoc")
Set gapp = CreateObject("acroexch.app")
Set gpddoc = CreateObject("acroexch.pddoc")
boK = avDoc.Open(PDFFilepath, PDFFileName)
gpddoc.Open (PDFFilepath)
Set jso = gpddoc.GetJSObject()
jso.SetUserPassword (Password)
jso.SetUserDigitalIDPath (PFXfile)
jso.SetSignTop (Top)
jso.SetSignLeft (Left)
jso.app.execMenuItem ("ADBESDK:AddSignature")
avDoc.Close (True)
gapp.Exit
End Sub
Now i am able to create PDF with Digital signature. But We want to assign password protection too..and problem is once we fix Digital signature we can't change security.
My problem is to pass password at the time of opening PDF for embedding signature. Password window should not prompt to the user while running VBA application.
Can you please help me to pass password on fly when file prompt password while opening PDF file. As file need to be opened at the time of fixing signature using sdk javascript code.
meghadwivedi@adobeforums.com Guest
-
OpenInWindowEx method fails to open password protected pdf file
Hi, I am getting error while loading the password protected pdf file using OpenInWindowEx method. Any Idea why or any fix of problem? Regards,... -
VB.net Open a pdf file with password!
Allo, I know how to open a file. Pdf who is with a password in vb.net thx -
Reader plug-in, save copy of passwordprotected pdf without password
Hello, We currently have an Acrobat Reader plugin (using the 8.1 SDK) and are having trouble with password protected PDFs. The sole purpose of... -
Passing code/data from code-behind to ASPX page
I have the following code in my code-behind file: DataGrid MAPPsDataGrid = (DataGrid)((((((Repeater) sender).Parent).Parent).Parent).Parent); ... -
Open file, make changes, save file, close, re-open, file contents not changed
I've now run into this several times and it's completely destroyed all of my confidence in Ilustrator CS on Mac. I'm hoping someone can confirm that... -
Leonard_Rosenthol@adobeforums.com #2
Re: Need javascript/VB code to open passwordprotected PDF file by passing password in codeitself.
Correct, you need to encrypt then sign.
Unfortunately, there is no way to pass a password for opening.
Leonard_Rosenthol@adobeforums.com Guest



Reply With Quote

