com.lowagie.text.pdf
public class PdfCopy extends PdfWriter
Nested Class Summary | |
---|---|
static class | PdfCopy.IndirectReferences
This class holds information about indirect references, since they are
renumbered by iText. |
protected static class | PdfCopy.RefKey
A key to allow us to hash indirect references |
Field Summary | |
---|---|
protected PdfIndirectReference | acroForm |
protected int | currentObjectNum |
protected HashMap | indirectMap |
protected HashMap | indirects |
protected List | newBookmarks |
protected PdfReader | reader |
Constructor Summary | |
---|---|
PdfCopy(Document document, OutputStream os)
Constructor |
Method Summary | |
---|---|
PdfIndirectReference | add(PdfImage pdfImage, PdfIndirectReference fixedRef) |
PdfIndirectReference | add(PdfOutline outline) |
PdfIndirectReference | add(PdfPage page, PdfContents contents) |
void | addAnnotation(PdfAnnotation annot) |
void | addPage(PdfImportedPage iPage)
Add an imported page to our output |
void | close()
Signals that the Document was closed and that no other
Elements will be added.
|
void | copyAcroForm(PdfReader reader)
Copy the acroform for an input document. |
protected PdfArray | copyArray(PdfArray in)
Translate a PRArray to a PdfArray. |
protected PdfDictionary | copyDictionary(PdfDictionary in)
Translate a PRDictionary to a PdfDictionary. |
protected PdfIndirectReference | copyIndirect(PRIndirectReference in)
Translate a PRIndirectReference to a PdfIndirectReference
In addition, translates the object numbers, and copies the
referenced object to the output file.
|
protected PdfObject | copyObject(PdfObject in)
Translate a PR-object to a Pdf-object |
protected PdfStream | copyStream(PRStream in)
Translate a PRStream to a PdfStream. |
void | freeReader(PdfReader reader) |
protected PdfDictionary | getCatalog(PdfIndirectReference rootObj) |
PdfImportedPage | getImportedPage(PdfReader reader, int pageNumber)
Grabs a page from the input document |
void | open() |
protected int | setFromIPage(PdfImportedPage iPage)
convenience method. |
protected void | setFromReader(PdfReader reader)
convenience method. |
void | setOutlines(List outlines)
Sets the bookmarks. |
Parameters: document os outputstream
Parameters: iPage an imported page
Throws: IOException, BadPdfFormatException
Document
was closed and that no other
Elements
will be added.
The pages-tree is built and written to the outputstream. A Catalog is constructed, as well as an Info-object, the referencetable is composed and everything is written to the outputstream embedded in a Trailer.
Parameters: reader The reader of the input file that is being copied
Throws: IOException, BadPdfFormatException
Parameters: reader the reader of the document pageNumber which page to get
Returns: the page
SimpleBookmark#
.Parameters: outlines the bookmarks or null
to remove any