Package com.lowagie.examples.general.copystamp

Source Code of com.lowagie.examples.general.copystamp.ConcatenateForms

/*
* $Id$
*
* 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();
    }
  }
}
TOP

Related Classes of com.lowagie.examples.general.copystamp.ConcatenateForms

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.