org.pdfbox.examples.persistence
Class AppendDoc

java.lang.Object
  extended by org.pdfbox.examples.persistence.AppendDoc

public class AppendDoc
extends Object

This example concatenates two documents and writes the result.

Version:
$Revision: 1.17 $
Author:
Michael Traut

Constructor Summary
AppendDoc()
          Constructor.
 
Method Summary
 void appendDocument(PDDocument destination, PDDocument source)
          append all pages from source to destination.
 void doIt(String in1, String in2, String out)
          concat two pdf documents.
static void main(String[] args)
          This will concat two pdf documents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppendDoc

public AppendDoc()
Constructor.

Method Detail

appendDocument

public void appendDocument(PDDocument destination,
                           PDDocument source)
                    throws IOException
append all pages from source to destination. todo: this method will go to the pdfmodel package one day

Parameters:
destination - the document to receive the pages
source - the document originating the new pages
Throws:
IOException - If there is an error accessing data from either document.

doIt

public void doIt(String in1,
                 String in2,
                 String out)
          throws IOException,
                 COSVisitorException
concat two pdf documents.

Parameters:
in1 - The first template file
in2 - The second template file
out - The created fiel with all pages from document one and document two
Throws:
IOException - If there is an error writing the data.
COSVisitorException - If there is an error generating the PDF document.

main

public static void main(String[] args)
This will concat two pdf documents.
see usage() for commandline

Parameters:
args - command line arguments


Copyright © 2006-2007 EGIZ - E-Government Innovationszentrum. All Rights Reserved.