PDDocument pdf = null;
COSDocument fdf = null;
FileInputStream pdfStream = null;
FileInputStream fdfStream = null;
FileOutputStream output = null;
PDFParser pdfParser = null;
PDFParser fdfParser = null;
COSWriter writer = null;
try
{
if( args.length != 3 )
{
usage();
}
else
{
ImportFDF importer = new ImportFDF();
pdfStream = new FileInputStream( args[0] );
fdfStream = new FileInputStream( args[1] );
output = new FileOutputStream( args[2] );
pdfParser = new PDFParser( pdfStream );
fdfParser = new PDFParser( fdfStream );
pdfParser.parse();
fdfParser.parse();
pdf = pdfParser.getPDDocument();
fdf = fdfParser.getDocument();
importer.importFDF( pdf, fdf );
writer = new COSWriter( output );
writer.write( pdf );
}