VeryPDF PDF Form Filler SDK(software development kit) provides unparalleled quality and reliability, allowing third-party developers to quickly add a PDF form filler to their own standalone applications. This PDF form filler can fill interactive PDF forms items such as text, check box, radio button, combo box, list box fields, etc. easily and supports to import/export form data from/or FDF and XML files.
With the help of VeryPDF PDF Form Filler SDK, software developers or programmers can flexibly implement and develop powerful PDF form solutions in a wide range of platforms such as Visual C++, Visual Basic, etc.
In the following contents, you will see some samples which illustrate how to use VeryPDF PDF Form Filler SDK.
Operating Systems: all the Windows platforms, like Windows 2000, XP, Vista, 7, 10, 11, Windows Server 2003, 2008, 2008 R2 and later systems, both 32 bit and 64 bit.
The following programming languages are supported:C#, VB .NET, MS Visual Basic, Borland Delphi, VBA (MS Office products such as Access) and C++ via COM, C and C++ via native C.
#include <windows.h>
#include "pdfformfunc.h"
void GetModulePath(char *out_path,char *in_name)
{
char *p;
GetModuleFileName(NULL,out_path,256);
p =strrchr(out_path,'\\');
p[1]=0;
strcat(out_path,in_name);
}
void PDFFormFilling1()
{
long id;
int nRet = -1;
char szOutPDF1[MAX_PATH];
char szOutPDF2[MAX_PATH];
char szPDFFile[MAX_PATH];
GetModulePath(szPDFFile,"example-fw9.pdf");
GetModulePath(szOutPDF1,"out1.pdf");
GetModulePath(szOutPDF2,"out2.pdf");
id = PDFForm_Alloc();
nRet = PDFForm_SetTextField(id, "f1-1", "1 Test for Name");
nRet = PDFForm_SetTextField(id, "f1-2", "1 Test for Business
Name");
nRet = PDFForm_SetTextField(id, "f1-3", "1 Test for f1-3");
nRet = PDFForm_SetTextField(id, "f1-4", "1 Test for f1-4");
nRet = PDFForm_SetTextField(id, "f1-5", "1 Test for f1-5");
nRet = PDFForm_SetTextField(id, "f1-6", "1 Test for f1-6");
nRet = PDFForm_SetCheckBox(id, "c1-4", "Off");
nRet = PDFForm_SetCheckBox(id, "c1-5", "Off");
nRet = PDFForm_SetCheckBox(id, "c1-1", "Yes");
nRet = PDFForm_SetCheckBox(id, "c1-2", "Yes");
nRet = PDFForm_Apply(id, szPDFFile, szOutPDF1, FALSE);
nRet = PDFForm_ClearFields(id);
nRet = PDFForm_SetTextField(id, "f1-1", "2 Test for Name");
nRet = PDFForm_SetTextField(id, "f1-2", "2 Test for Business
Name");
nRet = PDFForm_SetTextField(id, "f1-3", "2 Test for f1-3");
nRet = PDFForm_SetTextField(id, "f1-4", "2 Test for f1-4");
nRet = PDFForm_SetTextField(id, "f1-5", "2 Test for f1-5");
nRet = PDFForm_SetTextField(id, "f1-6", "2 Test for f1-6");
nRet = PDFForm_SetCheckBox(id, "c1-4", "Off");
nRet = PDFForm_SetCheckBox(id, "c1-5", "Off");
nRet = PDFForm_SetCheckBox(id, "c1-1", "Yes");
nRet = PDFForm_SetCheckBox(id, "c1-2", "Yes");
nRet = PDFForm_Apply(id, szPDFFile, szOutPDF2, TRUE);
nRet = PDFForm_Free(id);
char szOutPDF3[MAX_PATH];
GetModulePath(szOutPDF3,"out3_RepairFormFonts.pdf");
nRet = PDFForm_RepairFormFonts(szOutPDF1, szOutPDF3);
}
void main(int argc, char *argv[])
{
if(argc == 4)
{
BOOL bRet = PDFForm_MergeXFDFIntoPDF(argv[1],
argv[2], argv[3]);
return;
}
//Test for PDF Form Filling
PDFFormFilling1();
PDFFormFilling2();
return;
}
Private Function PDFFormFilling2()
Dim bRet As Long
Dim szInPDFFile As String
Dim szInFDFFile As String
Dim szInXFDFFile As String
Dim szOutPDFFile As String
Dim szOutPDFFileByXFDF As String
Dim szOutFDFFile As String
Dim szFlattenPDFFile As String
Dim szEncryptPDFFile As String
szInPDFFile = App.Path + "\example-fw9.pdf"
szInFDFFile = App.Path + "\example-fw9.fdf"
szInXFDFFile = App.Path + "\example-fw9.xfdf"
szOutPDFFile = App.Path + "\out-filled.pdf"
szOutPDFFileByXFDF = App.Path + "\out-filled-by-xfdf.pdf"
szOutFDFFile = App.Path + "\out.fdf"
szFlattenPDFFile = App.Path + "\out-flatten.pdf"
szEncryptPDFFile = App.Path + "\out-encrypt.pdf"
bRet = PDFForm_MergeFDFIntoPDF(szInPDFFile,
szInFDFFile, szOutPDFFile)
bRet = PDFForm_MergeXFDFIntoPDF(szInPDFFile,
szInXFDFFile, szOutPDFFileByXFDF)
bRet = PDFForm_ExtractFDFFromPDF(szOutPDFFile,
szOutFDFFile)
bRet = PDFForm_FlattenPDF(szOutPDFFile,
szFlattenPDFFile)
bRet = PDFForm_EncryptPDF(szOutPDFFile,
"123", "456", "Printing", 128, szEncryptPDFFile)
End Function
Private Sub PDFForm_Click()
PDFForm_SetLicenseKey ("XXXXXXXXXXXXXXXX")
PDFFormFilling1
PDFFormFilling2
End Sub
For details on how to use this SDK package, please download the trial version of VeryPDF PDF Form Filler SDK and have a try.
For full version of this SDK package, please buy VeryPDF PDF Form Filler SDK here.