Solved

Advice on FDF and PDF files

Posted on 2006-11-21
2
967 Views
Last Modified: 2012-05-05
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("POneEventQuote2007.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(POneEventQuote2007.pdf)/ID[<e099e1fa40427741839c37afe39f0f67><d9326d3e5b7f764b8c0bb9fa30e73040>]/Fields[<</T(A0)/V(N/A)>><</T(R9)/V(0)>><</T(Z5)/V(REPLACE_NAME\rREPLACE_ADDRESS)>>]>>>>" & 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_ADDRESS", "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
0
Comment
Question by:X-quisite
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Dimandja earned 500 total points
ID: 17988571
The PDF format is proprietary to Adobe Systems.  Adobe holds patents on their creation.  You can write your own 100% .NET applications that create and manipulate PDF files, if you obtain a licence to do so from Adobe.

Other than that, we have to use licenced third party tools.  You can look at a large collection of these PDF tools by entering something along the lines of ".NET create PDF" in a search engine.
0
 

Author Comment

by:X-quisite
ID: 17996740
Thanks for the advice... I was hoping there was another way (i.e. free!) to achieve the above tasks..
looks like I need to 'cough up some dough' :-(
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question