FDFMerge Full Featured Form Handling

  • Fill PDF forms with data from plain-text Forms Data Format (FDF) or XML Forms Data Format (XFDF) files
  • Place PDF, JPEG or TIFF graphics into fields
  • Remove active form fields, embedding field content directly into the document (form flattening)
  • Flatten selected fields or the entire form (partial form flattening)
  • Dynamically change form-field border width, colour and background colour
  • Dynamically format text fields — font, point size, alignment, colour and more
  • Use advanced typography — character spacing, word spacing and line leading
  • Support for both RGB and CMYK colour
  • Run Command Collections for even greater performance

See It Work

Fill a form and flatten it in one command:

fdfmerge -s -o filled.pdf application.pdf applicant-data.fdf

Control individual fields with a plain-text FormInfo file — drop a signature image into one field, right-align a total in bold red in another:

BeginField
  FieldName      Signature
  Type           Image
  ImageFileName  /data/sig-4471.tif
EndField

BeginField
  FieldName      Total
  FontName       Helvetica-Bold
  Justification  Right
  ColorRed       192
  ColorGreen     0
  ColorBlue      0
EndField

No SDK, no build step, nothing to compile — a command and a file your team can read.

How FDFMerge compares

There are two usual ways to fill a PDF form on a server. Free command-line utilities cost nothing but do one thing — drop data into fields and, on request, flatten the whole form; they cannot style a field, place a graphic in one, or flatten part of a form and leave the rest live, and the best known of them has not had a release in over a decade. Developer libraries can do far more, but every capability is code someone has to write and maintain, and most carry a licence to clear before you ship. FDFMerge is a third option — the control of a library, driven from a plain-text file, with no programming and nothing embedded in your application.

Capability FDFMerge Free command-line tools Developer libraries
Flatten selected fields, leave the rest interactive Yes No Yes, in code
Place a PDF, JPEG or TIFF into a field Yes No Yes, in code
Per-field border, background, font, size, colour Yes No Yes, in code
Character spacing, word spacing, line leading Yes No No
RGB and CMYK colour Yes No Sometimes, in code
No programming required Yes Yes No

Two of those rows are uncommon anywhere: per-field typographic control is something developer libraries leave to hand-written code and the free tools do not offer at all, and CMYK field colour is not exposed by every PDF library.

File Handling Options

  • Process multiple forms using one FDF or XFDF file
  • Apply 40-bit or 128-bit encryption with a user password to control who may view, print or modify a document
  • Linearize output for faster viewing over the web or a network (Fast Web View)
  • Incremental or full save to tune speed, memory use and file size
  • Optimize to reduce file size
  • Set the output version for ISO 32000 compliance (PDF 1.7)

Easy to integrate

Call FDFMerge from any application to pre-fill forms from a database, capture submitted form data, or generate documents in a multistage workflow alongside other Appligent server products.

  • No limit on concurrent users or connections
  • No limit on the number of documents processed
  • No limit on threads — run as many instances as you want
  • Call from any programming or scripting language, including Perl, PHP, Java, C++, ASP and .NET, Visual Basic, ColdFusion and Lotus Notes
  • Combine with other Appligent server products as part of a complete PDF workflow
  • Supports PDF 1.0 and higher

Supported Operating Systems

  • Microsoft Windows (32- and 64-bit)
  • Linux (64-bit)
  • IBM AIX
  • Oracle Solaris (SPARC)

Questions

Is FDFMerge an alternative to pdftk?
Yes. pdftk fills forms and flattens them whole; FDFMerge adds partial flattening, graphics in fields, per-field styling and CMYK colour — and it is a supported, maintained product. pdftk has not had a release since 2013.

Do I need to install Adobe Acrobat on the server?
No. You do not need to install or license Adobe Acrobat, or any separate Adobe product. FDFMerge is a self-contained command-line application, built on the Adobe PDF Library, so you get correctly formed PDF output without an Acrobat installation.

Does it work with XFDF as well as FDF?
Yes. FDFMerge reads both, and XFDF is the way to carry Unicode form data, including Chinese, Japanese and Korean text.

Can I fill forms in bulk?
Yes. Use a Command Collection to process many forms in one run. FDFMerge is thread-safe with no limit on concurrent use — the reason it is used for high-volume banking and government workflows.

Can I flatten only some fields and leave the rest fillable?
Yes — partial flattening. Name the fields to flatten in a FormInfo file and the rest of the form stays interactive. The free command-line tools flatten all-or-nothing.

What platforms does it run on?
Windows (32- and 64-bit) and Linux (64-bit) — and, for organizations that need them, the enterprise Unix platforms AIX and Solaris.

Documentation

  • The User Guide provides complete product documentation.
  • Free sample scripts for calling FDFMerge (in ASP, PERL, PHP, Java, & Visual Basic)
  • Free Java Command Line FDF Generator Source Code (.tar.gz, 7k)

Sample Scripts and Code

The following examples show only the critical elements needed to set up the command line call, invoke the application and capture the returned code.  Contact us if you need assistance in developing PHP or Perl scripts for our applications

The Command Line Interface (CLI) is a powerful programming technique useful in any server environment. All Appligent Document Solutions server-based applications include a CLI and can easily be placed in any workflow, using any programming language or scripting environment. In addition, most of the Appligent applications also support Watched Folders and/or Watched Directories for easily fitting into just about any workflow.

Please see the documentation for the specific product to learn about all of the product features at docs.appligent.com

NOTE: We use FDFMerge to demonstrate the correct syntax below, but the name of any of our server-based applications may be substituted.

Download complete PHP example.

#Built the Executable statement $FDFMergeAppl = "$FdfMerge ";
  $FdfMergeParms = "-s -p -l $LogFile -o $OutPdfFile $InPdfFile $InFdfFile";
  $FdfMergeCmd = $FDFMergeAppl . $FdfMergeParms;

#Execute the FDFMerge command line and get the return code.
  $Return = system($FdfMergeCmd);

Download complete ASP example.

'Built the Executable statement
sFdfMergeAppl = sFdfMerge
sFdfMergeParms = " -s -p -l " & sLogFile & " -o " & sOutPDFFile
sFdfMergeParms = sFdfMergeParms & " " &InPdfFile & " " & sInFdfFile
sFdfMergeCmd = sFdfMergeAppl & " " & sFdfMergeParms

'Create the Shell object to run the FDFMerge command line.
 Set wShell = Server.CreateObject("WScript.Shell")

'Execute the FDFMerge command line and get the return code.
 iReturn = wShell.Run( sFdfMergeCmd, 10, True )
 Set wShell = Nothing

Download complete Pearl example.

#Built the Executable statement
  $FDFMergeAppl = "$FdfMerge ";
  $FdfMergeParms = "-s -p -l $LogFile -o $OutPdfFile $InPdfFile $InFdfFile';
  $FdfMergeCmd = $FDFMergeAppl . $FdfMergeParms;

#Execuate the FDFMerge command line and get the return code.
  $Return = '$FdfMergeCmd';

Download complete Java example or alternate example.

// Built the Executable Statement
sFdfMergeAppl = sFdfMerge;
sFdfMergeParms = " -s -p -l " + sLogFile + " -o " + sOutPDFFile;
sFdfMergeParms = sFdfMergeParms + " " + InPdfFile + " " + sInFdfFile;

// Add "cmd /c" if you are running on Windows (Leave out if running on Unix)
sFdfMergeCmd = "cmd /c " + sFdfMergeAppl + " " + sFdfMergeParms;

// Create the process to run the FDFMerge command line.
Process cmdlProcess;

// Execute the FDFMerge command line and get the return code.
cmdlProcess = Runtime.getRuntime( ).exe ( sFdfMergeCmd  );
cmdlProcess.waitFor ( );
iReturn = cmdlProcess.exitValue( );

Download complete Visual Basic example.

'Built the Executable statement
 sFdfMergeAppl = sFdfMerge
 sFdfMergeParms = " -s -p -l " & sLogFile & "-o " & sOutPDFFile
 sFdfMergeParms = sFdfMergeParms & " " &InPdfFile & " " & sInFdfFile
 sFdfMergeCmd = sFdfMergeAppl & " " & sFdfMergeParms

'Execute the FDFMerge command line and get the return code.
 iReturn = Shell(sFdfMergeCmd)

Back to top