Here is the first half of the code that extracts the information.
Code: Select all
F8::
oAcrobat := ComObjCreate("acroExch.App")
oAcrobatdoc := ComObjCreate("acroexch.avdoc") ; create an document object
oAcrobat.show() ; make the application object visible or .hide it
Part1Document := ComObjCreate("AcroExch.PDDoc")
App := ComObjCreate("AcroExch.App")
AVDoc := App.GetActiveDoc()
PDDoc := AVDoc.GetPDDoc()
JSO := PDDoc.GetJSObject
field_name := JSO.GetNthFieldName(5)
last_name := JSO.GetField(field_name).Value ;gets the last name
last_name := JSO.GetField(field_name).Value := "test"
field_name := JSO.GetNthFieldName(6)
first_name := JSO.GetField(field_name).Value ;gets the first name
field_name := JSO.GetNthFieldName(16)
dob := JSO.GetField(field_name).Value ;gets the dob
file_name := last_name . "_" . first_name . "_" . StrReplace(dob, "/", "") . "_i693" ;sets up a file name
MsgBox, % file_name
Code: Select all
App := ComObjCreate("AcroExch.App")
AVDoc := ComObjCreate("AcroExch.AVDoc")
PVDoc := AVDoc.GetPDDoc()
PDSaveIncremental := 0x0000 ;/* write changes only */
PDSaveFull := 0x0001 ;/* write entire file */
PDSaveCopy := 0x0002 ;/* write copy w/o affecting current state */
PDSaveLinearized := 0x0004 ;/* write the file linearized for
PDSaveBinaryOK := 0x0010 ;/* OK to store binary in file */
PDSaveCollectGarbage := 0x0020 ;/* perform garbage collection on
PVDoc.save(PDSaveFull, A_Desktop . "\" . file_name . ".pdf")
PVDoc.close()
App.CloseAllDocs()
App.exit()
return