Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 927a1532fb070c51449654bb68b5bde2 > files > 135

itext-manual-2.0.8-0.0.2mdv2008.1.i586.rpm

/*
 * $Id: ConcatenateForms.java,v 1.2 2006/09/12 13:48:51 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.
 */
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();
		}
	}
}