Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > media > contrib-release > by-pkgid > 29e0da3ddcddab73ae8621fc62033227 > files > 120

itext-manual-1.4.5-1mdv2007.0.i586.rpm

/*
 * $Id: ConcatenateForms.java,v 1.1 2005/04/14 12:28:14 blowagie Exp $
 * $Name:  $
 *
 * This code is free software. It may only be copied or modified
 * if you include the following copyright notice:
 *
 * This class by Mark Thompson. Copyright (c) 2002 Mark Thompson.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * itext@lowagie.com
 */
package com.lowagie.examples.general.copystamp;

import java.io.FileOutputStream;

import com.lowagie.text.pdf.PdfCopyFields;
import com.lowagie.text.pdf.PdfReader;

/**
 * Concatenates 2 PDF files with forms. The resulting PDF has 1 merged AcroForm.
 */
public class ConcatenateForms {

	/**
	 * Concatenates 2 PDF files with forms. The resulting PDF has 1 merged AcroForm.
	 * @param args  no arguments needed
	 */
	public static void main(String[] args) {
		try {
			PdfReader reader1 = new PdfReader("SimpleRegistrationForm.pdf");
			PdfReader reader2 = new PdfReader("TextFields.pdf");
			PdfCopyFields copy = new PdfCopyFields(new FileOutputStream("concatenatedforms.pdf"));
			copy.addDocument(reader1);
			copy.addDocument(reader2);
			copy.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}