We help IT Professionals succeed at work.

asp.net / c# / fdf

Webboy2008
Webboy2008 asked
on
I plan to purchase FDF software from  http://www.nk-inc.com/software/fdftoolkit.net/fdftoolkitnet20.aspx

However, most of the codes in vb.net and other c# sample does not seem working.

All I have to do is. I have like insurance application with 2 fields first name and last name in the pdf
I need to use FDF and populate first / last name value to the pdf.

Does anyone use this software in the past? And can show me how to code them in c#/ asp.net?

Thanks
Comment
Watch Question

I don't know anything about FDF but before you spend your money, you may want to check out: http://itextpdf.com/

-MJC
There's a c# example of filling fields for that library here: http://itextpdf.com/examples/iia.php?id=157 (among many others here: http://itextpdf.com/themes/keywords.php

Author

Commented:
I need more samples using asp.net/c#.
Most Valuable Expert 2011
Top Expert 2015

Commented:
You *could* put the samples you have through an online converter:

http://www.developerfusion.com/tools/convert/vb-to-csharp/
http://converter.telerik.com/
Commented:
See examples below...

I'm assuming you already know how to use Visual Studio, and you can reference both iTextSharp.dll, and FDFApp.dll in your project.

// using FDFApp;
private FDFApp.FDFApp_Class cFDFApp = new FDFApp.FDFApp_Class();
private FDFApp.FDFDoc_Class cFDFDoc = new FDFApp.FDFDoc_Class();

protected void PopulateAcrobatPDF()
        {
            FDFApp.FDFApp_Class cFDFApp = new FDFApp.FDFApp_Class();
            FDFApp.FDFDoc_Class cFDFDoc = new FDFApp.FDFDoc_Class();
            cFDFDoc = cFDFApp.FDFCreate();

            //ACROBAT PDF
            cFDFDoc.FDFSetFile(@"C:\myBlankFormLiveCycle.pdf");
            cFDFDoc.FDFSetValue("FirstName", "Bill", true, true);
            cFDFDoc.FDFSetValue("LastName", "Gates", true, true);
            
            //SEND TO BUFFER
            Response.Clear();
            Response.ContentType = cFDFApp.MimeFDF;
            cFDFDoc.FDFSetStatus("Status: Loaded Successfully!", true);
            Response.BinaryWrite(cFDFDoc.FDFSavetoBuf(FDFDoc_Class.FDFType.FDF, true));
            Response.End();
    
        }
        protected void PopulateLiveCyclePDF()
        {
            FDFApp.FDFApp_Class cFDFApp = new FDFApp.FDFApp_Class();
            FDFApp.FDFDoc_Class cFDFDoc = new FDFApp.FDFDoc_Class();
            cFDFDoc = cFDFApp.FDFCreate();

            //LiveCycle PDF AND 
            cFDFDoc.XDPAddForm("TopMostSubForm", @"C:\myBlankFormLiveCycle.pdf");
            cFDFDoc.XDPSetValue("FirstName", "Bill", true, true);
            cFDFDoc.XDPSetValue("LastName", "Gates", true, true);
            
            //SEND TO BUFFER
            Response.Clear();
            Response.ContentType = cFDFApp.MimeXDP; 
            cFDFDoc.FDFSetStatus("Status: Loaded Successfully!", true);
            Response.BinaryWrite(cFDFDoc.FDFSavetoBuf(FDFDoc_Class.FDFType.XDP, true));
            Response.End();

        }

Open in new window