I currently have a vb form (vs2008) which pulls information from a SQL table. It then generates a FDF output of certain information on the form, and then opens the FDF file which then merges back in with the PDF file. I have this fully working on a Windows XP machine, but I cannot get it to work properly on Windows 8. I have tried defining the path but I'm concerned that different versions of Adobe Reader could lead to problems later when the app is installed.
My code for FDF output:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FdfAcX As FDFACXLib.FdfApp
FdfAcX = CreateObject("FdfApp.FdfApp")
Dim fdf As FDFACXLib.FdfDoc
fdf = FdfAcX.FDFCreate
fdf.FDFSetFile(Application.StartupPath & "\Enquiry Form - Company.pdf")
fdf.FDFSetValue("lnamount", LoanAmount.Text, False)
fdf.FDFSetValue("estval", EstimatedValueTextBox.Text, False)
fdf.FDFSetValue("loanpurpose", LoanPurpose.Text, False)
fdf.FDFSetValue("term", LoanTerm.Text, False)
fdf.FDFSaveToFile(Application.StartupPath & "\Enquiry Form - Company.fdf")
Command2_Click()
End Sub
Which links to the code for the FDF open:
Private Sub Command2_Click()
Dim file As String
file = Application.StartupPath & "\Enquiry Form - Company.fdf"
Process.Start(file)
End Sub
which works on Windows XP, but not on Windows 8. Please Help, it's driving me mental.
When I run the app on Windows 8, it runs fine and pulls from SQL correctly, however when I go to click on the button, I get an unhandled exception error.
Happy to post the error if needed.
I have figured out the problem. The issue is that FDFACX.dll will not register as it should in a Windows 8 environment. My solution was to run command prompt with Administrator access and manually register FDFACX.dll. My app now works. I hope this will help someone else with a similar issue.