X-quisite
asked on
Advice on FDF and PDF files
Hi,
I need some urgent advice on FDF and PDF files..
I have created VB.NET app with MS SQL back end.
I also have PDF documents that need to be populated with data from app that I have developed.
Looking through EE, I came across the following code:
Dim sb As New System.Text.StringBuilder
Dim file As New System.IO.StreamWriter("PO neEventQuo te2007.fdf ")
Try
'***Create a replica of the FDF file's contents by creating a string containing all the
'***information in the FDF file.
'***vbCr's replace Hex value x0D found when viewing the original FDF File with a hex
'***viewer.
sb.Append("%FDF-1.2" & vbCr & "%âãÏÓ" & vbCrLf)
sb.Append("1 0 obj<</FDF<</F(POneEventQuo te2007.pdf )/ID[<e099 e1fa404277 41839c37af e39f0f67>< d9326d3e5b 7f764b8c0b b9fa30e730 40>]/Field s[<</T(A0) /V(N/A)>>< </T(R9)/V( 0)>><</T(Z 5)/V(REPLA CE_NAME\rR EPLACE_ADD RESS)>>]>> >>" & vbCr & "endobj" & vbCr & "trailer" & vbCrLf)
sb.Append("<</Root 1 0 R>>" & vbCrLf)
sb.Append("%%EOF" & vbCrLf)
'***Replace the default values with the "real" values
sb.Replace("REPLACE_NAME", "John Smith")
sb.Replace("REPLACE_ADDRES S", "London, UK")
file.WriteLine(sb)
file.Close()
Catch ex As Exception
MessageBox.Show(ex.Message , strAppTitle)
'***Code to display your error goes here.
End Try
This allows me to create an FDF file, which when accessed will open the pdf file with the fields populated.
My questions are:
1. Is there a quicker to achieve the above, without going for 3rd party apps? (what if the pdf form has alot of text fields to populate?)
2. What i also want to do is to save the PDF with the data populated from the FDF without having to open the PDF and saving it in Reader. Can this be done in VB.NET?
3. Also on the PDF form, there are some fields (Combo boxes) that trigger some events in Javascript, now these dont show up in the FDF structure, is there anyway around this?
Looking forward to your suggestions,
XQ
I need some urgent advice on FDF and PDF files..
I have created VB.NET app with MS SQL back end.
I also have PDF documents that need to be populated with data from app that I have developed.
Looking through EE, I came across the following code:
Dim sb As New System.Text.StringBuilder
Dim file As New System.IO.StreamWriter("PO
Try
'***Create a replica of the FDF file's contents by creating a string containing all the
'***information in the FDF file.
'***vbCr's replace Hex value x0D found when viewing the original FDF File with a hex
'***viewer.
sb.Append("%FDF-1.2" & vbCr & "%âãÏÓ" & vbCrLf)
sb.Append("1 0 obj<</FDF<</F(POneEventQuo
sb.Append("<</Root 1 0 R>>" & vbCrLf)
sb.Append("%%EOF" & vbCrLf)
'***Replace the default values with the "real" values
sb.Replace("REPLACE_NAME",
sb.Replace("REPLACE_ADDRES
file.WriteLine(sb)
file.Close()
Catch ex As Exception
MessageBox.Show(ex.Message
'***Code to display your error goes here.
End Try
This allows me to create an FDF file, which when accessed will open the pdf file with the fields populated.
My questions are:
1. Is there a quicker to achieve the above, without going for 3rd party apps? (what if the pdf form has alot of text fields to populate?)
2. What i also want to do is to save the PDF with the data populated from the FDF without having to open the PDF and saving it in Reader. Can this be done in VB.NET?
3. Also on the PDF form, there are some fields (Combo boxes) that trigger some events in Javascript, now these dont show up in the FDF structure, is there anyway around this?
Looking forward to your suggestions,
XQ
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
looks like I need to 'cough up some dough' :-(