Here's how to accomplish this using Adobe's FDF Toolkit and C# as I wasn't able to find a good source on how to build a similar app in C# when I was once in need. This guide assumes you have some familiarity working with .NET, C#, Acrobat, FDF (Form Data Form), and PDF.
Create your PDF using Adobe Acrobat
- Open an existing PDF or create a new file
- Create a text field
- Name it: fooField
- Save your PDF as myfile.pdf
- Download FDF Toolkit from Adobe Developer Center
- Copy the files fdfacx.dll and fdftk.dll to a folder on your web server, either a global folder or even your application's /bin folder.
- From the Windows Command Prompt, type: regsvr32 c:\path\to\file\fdfacx.dll where path\to\file is the actual path to the file.
- Use the Type Library Importer included with Visual Studio to create a CLR assembly. At the Command Prompt, type: tlbimp FdfAcX.dll /out:fdfacx_clr.dll (modify paths as necessary).
- Place the newly created CLR assembly fdfacx_clr.dll in your .NET application's /bin folder.
using fdfacx_clr; // include generated CLR assembly private string foo; foo = "bar"; FdfAppClass FdfAcX_App = new FdfAppClass(); FdfDoc outputFDF = (FdfDoc)FdfAcX_App.FDFCreate(); outputFDF.FDFSetFile("http://path/to/pdf/myfile.pdf"); // absolute web path to your pdf file outputFDF.FDFSetValue("fooField", foo, false); outputFDF.FDFSetStatus(foo + " will now be inserted into fooField"); Response.ContentType = "application/vnd.fdf"; Response.Write(outputFDF.FDFSaveToStr()); Response.End(); outputFDF.FDFClose();That's it. Fire up your C# ASP.Net web application and navigate to your start page and it should create a FDF on the fly that will point to your PDF.
Forgive me if I've left anything out or made any errors as it's been awhile since I actually worked on the project. Leave a comment if you run into any problems!