Steve,
No, I am using VB.NET, Acrobat ActiveX Automation. This function accepts a template PDF file and the output PDF file, and populates the Text Box and Checkboxes. Only the Text Box value is retained in the saved file. I can send you examples if you like.
' -----------------------------------------
' Required References for Adobe Automation:
' -----------------------------------------
' Adobe Acrobat 9.0 Type Library 1.1.0.0
' AFormAut 1.0 Type Library 1.0.0.0
Private Sub PopulateTemplateAndSaveFile(ByVal templateFile As String, ByVal saveFile As String)
Try
Dim AcroXApp As Acrobat.CAcroApp
Dim AcroXAVDoc As Acrobat.CAcroAVDoc
Dim AcroXPDDoc As Acrobat.CAcroPDDoc
Dim AcroXFields As AFORMAUTLib.Fields
Dim AFormApp As AFORMAUTLib.AFormApp
AcroXApp = New Acrobat.AcroApp
AcroXAVDoc = New Acrobat.AcroAVDoc
AcroXPDDoc = New Acrobat.AcroPDDoc
If AcroXAVDoc.Open(templateFile, "XYZTemplate") Then
AcroXAVDoc.BringToFront()
AcroXApp.Hide()
AcroXPDDoc = AcroXAVDoc.GetPDDoc
AFormApp = New AFORMAUTLib.AFormApp
AcroXFields = AFormApp.Fields
' Get Fully Qualified Field Names
'For Each myField As AFORMAUTLib.Field In AcroXFields
' MsgBox(myField.Name)
'Next myField
AcroXFields.Item("form1[0].#subform[0].txtName[0]").Value = "Gordon Bell"
AcroXFields.Item("form1[0].#subform[0].chkBox1[0]").Value = "1"
AcroXFields.Item("form1[0].#subform[0].chkBox2[0]").Value = "0"
AcroXFields.Item("form1[0].#subform[0].chkBox3[0]").Value = "1"
AcroXPDDoc.Save(Acrobat.PDSaveFlags.PDSaveFull, saveFile)
AcroXPDDoc.ClearFlags(&H1)
AcroXPDDoc.Close()
End If
AcroXFields = Nothing
AFormApp = Nothing
If AcroXAVDoc IsNot Nothing Then
AcroXAVDoc.Close(True)
AcroXAVDoc = Nothing
End If
AcroXPDDoc = Nothing
If AcroXApp IsNot Nothing Then
AcroXApp.CloseAllDocs()
AcroXApp.Exit()
AcroXApp = Nothing
End If
MsgBox("Saved.")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation)
End Try
End Sub