public class PdfAppender
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected PdfManager[] |
_m
The array of PDF managers.
|
protected boolean |
_printFileNames
A flag used to indicate whether file names should be
printed during the appending process.
|
protected int |
_renumber_offset
The current amount to offset (increase) all object numbers
by.
|
protected boolean |
_used
Stores whether the
append() method has
been used. |
protected PdfWriter |
_w
The PDF writer.
|
| Constructor and Description |
|---|
PdfAppender(java.util.List managers,
PdfWriter writer)
The class is initialized to read a list of PDF documents
(
PdfManager objects) in order and to write the
resultant document to a specified PdfWriter. |
PdfAppender(PdfManager[] managers,
PdfWriter writer)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append()
Performs the append operation.
|
static void |
main(java.lang.String[] args)
Appends multiple PDF documents together using this class.
|
protected static PdfObject |
renumber(PdfObject obj,
int offset) |
protected boolean _printFileNames
protected PdfManager[] _m
protected int _renumber_offset
protected boolean _used
append() method has
been used.protected PdfWriter _w
public PdfAppender(PdfManager[] managers, PdfWriter writer)
PdfAppender(List, PdfWriter).PdfManager objects) in order and to write the
resultant document to a specified PdfWriter.
The PdfWriter should be newly created (i.e. it
should not have been previously used for anything); and
after append() has been called, the
PdfWriter should be closed and discarded, and
this PdfAppender should be discarded.managers - the documents to read.writer - the document to write to.public PdfAppender(java.util.List managers,
PdfWriter writer)
throws PdfFormatException
PdfManager objects) in order and to write the
resultant document to a specified PdfWriter.
The PdfWriter should be newly created (i.e. it
should not have been previously used for anything); and
after append() has been called, the
PdfWriter should be closed and discarded, and
this PdfAppender should be discarded.managers - the documents to read. This must be a list
of PdfManager objects.writer - the document to write to.PdfFormatExceptionprotected static PdfObject renumber(PdfObject obj, int offset) throws PdfFormatException
PdfFormatExceptionpublic void append()
throws java.io.IOException,
PdfFormatException
java.io.IOExceptionPdfFormatExceptionpublic static void main(java.lang.String[] args)
throws java.io.IOException,
PdfFormatException
args - the list of file names. Note that the last
file in this list (args[args.length - 1]) is
overwritten with the resultant PDF document.java.io.IOExceptionPdfFormatException