## com.lowagie.text.pdf
Class PdfCopyFieldsImp

    java.lang.Object
      com.lowagie.text.DocWriter
          com.lowagie.text.pdf.PdfWriter
              com.lowagie.text.pdf.PdfCopyFieldsImp

All Implemented Interfaces:
  DocListener, ElementListener, java.util.EventListener

     class PdfCopyFieldsImp

extends PdfWriter

Author:
  psoares

Nested Class Summary

Nested classes/interfaces inherited from class com.lowagie.text.pdf.PdfWriter
`PdfWriter.PdfBody, PdfWriter.PdfTrailer`

Field Summary
`private java.util.ArrayList` `calculationOrder`
`private java.util.ArrayList` `calculationOrderRefs`
`(package private) boolean` `closing`
`protected static java.util.HashMap` `fieldKeys`
`(package private) java.util.ArrayList` `fields`
`(package private) java.util.HashMap` `fieldTree`
`(package private) RandomAccessFileOrArray` `file`
`(package private) PdfDictionary` `form`
`private static PdfName` `iTextTag`
`(package private) Document` `nd`
`protected java.util.List` `newBookmarks`
`(package private) java.util.ArrayList` `pageDics`
`(package private) java.util.ArrayList` `pageRefs`
`(package private) java.util.HashMap` `pages2intrefs`
`(package private) java.util.ArrayList` `readers`
`(package private) java.util.HashMap` `readers2intrefs`
`(package private) PdfDictionary` `resources`
`private java.util.HashMap` `tabOrder`
`(package private) java.util.HashMap` `visited`
`protected static java.util.HashMap` `widgetKeys`
`private static java.lang.Integer` `zero`

Fields inherited from class com.lowagie.text.pdf.PdfWriter

`AllowAssembly, AllowCopy, AllowDegradedPrinting, AllowFillIn, AllowModifyAnnotations, AllowModifyContents, AllowPrinting, AllowScreenReaders, body, CenterWindow, colorNumber, crypto, currentPageNumber, currentPdfReaderInstance, defaultColorspace, DID_PRINT, DID_SAVE, directContent, directContentUnder, DirectionL2R, DirectionR2L, DisplayDocTitle, DOCUMENT_CLOSE, documentColors, documentExtGState, documentFonts, documentOCG, documentOCGorder, documentPatterns, documentProperties, documentShadingPatterns, documentShadings, documentSpotPatterns, FitWindow, fontNumber, formXObjects, formXObjectsCounter, fullCompression, group, HEADER, HideMenubar, HideToolbar, HideWindowUI, imageDictionary, importedPages, NO_SPACE_CHAR_RATIO, NonFullScreenPageModeUseNone, NonFullScreenPageModeUseOC, NonFullScreenPageModeUseOutlines, NonFullScreenPageModeUseThumbs, OCGRadioGroup, OCProperties, PAGE_CLOSE, PAGE_OPEN, PageLayoutOneColumn, PageLayoutSinglePage, PageLayoutTwoColumnLeft, PageLayoutTwoColumnRight, PageLayoutTwoPageLeft, PageLayoutTwoPageRight, PageModeFullScreen, PageModeUseAttachments, PageModeUseNone, PageModeUseOC, PageModeUseOutlines, PageModeUseThumbs, pageReferences, patternColorspaceCMYK, patternColorspaceGRAY, patternColorspaceRGB, patternNumber, pdf, PDFX1A2001, PDFX32002, PDFXKEY_CMYK, PDFXKEY_COLOR, PDFXKEY_FONT, PDFXKEY_GSTATE, PDFXKEY_IMAGE, PDFXKEY_LAYER, PDFXKEY_RGB, PDFXNONE, prevxref, PrintScalingNone, root, RUN_DIRECTION_DEFAULT, RUN_DIRECTION_LTR, RUN_DIRECTION_NO_BIDI, RUN_DIRECTION_RTL, runDirection, SIGNATURE_APPEND_ONLY, SIGNATURE_EXISTS, SPACE_CHAR_RATIO_DEFAULT, STRENGTH128BITS, STRENGTH40BITS, structureTreeRoot, tagged, userunit, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, VERSION_1_6, ViewerPreferencesMask, WILL_PRINT, WILL_SAVE, xmpMetadata`

Fields inherited from class com.lowagie.text.DocWriter
`closeStream, document, EQUALS, FORWARD, GT, LT, NEWLINE, open, os, pageSize, pause, QUOTE, SPACE, TAB`

Constructor Summary
`PdfCopyFieldsImp(java.io.OutputStream os)`
`PdfCopyFieldsImp(java.io.OutputStream os, char pdfVersion)`

Method Summary
`(package private) void` `addDocument(PdfReader reader)`
`(package private) void` `addDocument(PdfReader reader, java.util.List pagesToKeep)`
`(package private) void` `addPageOffsetToField(java.util.HashMap fd, int pageOffset)`
`private void` `adjustTabOrder(PdfArray annots, PdfIndirectReference ind, PdfNumber nn)`
`protected PdfArray` `branchForm(java.util.HashMap level, PdfIndirectReference parent, java.lang.String fname)`
`void` `close()` Signals that the `Document` was closed and that no other `Elements` will be added.
`protected void` `closeIt()`
`protected void` `createAcroForms()`
`(package private) void` `createWidgets(java.util.ArrayList list, AcroFields.Item item)`
`protected PdfDictionary` `getCatalog(PdfIndirectReference rootObj)`
`private static java.lang.String` `getCOName(PdfReader reader, PRIndirectReference ref)`
`protected int` `getNewObjectNumber(PdfReader reader, int number, int generation)`
`protected PdfIndirectReference` `getNewReference(PRIndirectReference ref)`
`PdfIndirectReference` `getPageReference(int page)` Gets a reference to a page existing or not.
`(package private) RandomAccessFileOrArray` `getReaderFile(PdfReader reader)`
`protected boolean` `isPage(PRIndirectReference ref)`
`protected boolean` `isVisited(PdfReader reader, int number, int generation)`
`protected boolean` `isVisited(PRIndirectReference ref)`
`(package private) void` `mergeField(java.lang.String name, AcroFields.Item item)`
`(package private) void` `mergeFields()`
`(package private) void` `mergeWithMaster(java.util.HashMap fd)`
`void` `openDoc()`
`(package private) void` `propagate(PdfObject obj, PdfIndirectReference refo, boolean restricted)`
`void` `setOutlines(java.util.List outlines)` Sets the bookmarks.
`protected boolean` `setVisited(PRIndirectReference ref)`
`private void` `updateCalculationOrder(PdfReader reader)`

Methods inherited from class com.lowagie.text.pdf.PdfWriter

`add, add, add, addAnnotation, addAnnotation, addCalculationOrder, addDirectImageSimple, addDirectImageSimple, addDirectTemplateSimple, addFileAttachment, addFileAttachment, addJavaScript, addJavaScript, addJavaScript, addLocalDestinations, addOCGRadioGroup, addSharedObjectsToBody, addSimple, addSimple, addSimpleExtGState, addSimplePattern, addSimplePatternColorspace, addSimpleProperty, addSimpleShading, addSimpleShadingPattern, addToBody, addToBody, addToBody, addToBody, addToBody, addToBody, breakTableIfDoesntFit, checkPDFXConformance, createXmpMetadata, eliminateFontSubset, fitsPage, fitsPage, fitsPage, fitsPage, freeReader, getAcroForm, getBoxSize, getColorspaceName, getCurrentDocumentSize, getCurrentPage, getCurrentPageNumber, getDefaultColorspace, getDirectContent, getDirectContentUnder, getEncryption, getExtraCatalog, getGroup, getImageReference, getImportedPage, getIndirectReferenceNumber, getInfo, getInstance, getInstance, getOCProperties, getOs, getPageEvent, getPageNumber, getPageSize, getPdfDocument, getPdfIndirectReference, getPdfTable, getPDFXConformance, getRootOutline, getRunDirection, getSpaceCharRatio, getStructureTreeRoot, getTableBottom, getUserunit, getVerticalPosition, isFullCompression, isPaused, isStrictImageSequence, isTagged, open, propertyExists, registerLayer, releaseTemplate, reorderPages, resetContent, setAdditionalAction, setBoxSize, setCropBoxSize, setDefaultColorspace, setDuration, setEncryption, setEncryption, setFullCompression, setGroup, setLinearPageMode, setOpenAction, setOpenAction, setOutputIntents, setOutputIntents, setPageAction, setPageEmpty, setPageEvent, setPageLabels, setPdfVersion, setPDFXConformance, setRunDirection, setSigFlags, setSpaceCharRatio, setStrictImageSequence, setTagged, setThumbnail, setTransition, setUserunit, setViewerPreferences, setXmpMetadata`

Methods inherited from class com.lowagie.text.DocWriter
`add, add, addTabs, clearTextWrap, flush, getISOBytes, hasMarkupAttributes, isCloseStream, newPage, pause, removeWatermark, resetFooter, resetHeader, resetPageCount, resume, setCloseStream, setFooter, setHeader, setMarginMirroring, setMargins, setPageCount, setPageSize, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### iTextTag

    private static final PdfName iTextTag

### zero

    private static final java.lang.Integer zero

### readers

    java.util.ArrayList readers

### readers2intrefs

    java.util.HashMap readers2intrefs

### pages2intrefs

    java.util.HashMap pages2intrefs

### visited

    java.util.HashMap visited

### fields

    java.util.ArrayList fields

### file

    RandomAccessFileOrArray file

### fieldTree

    java.util.HashMap fieldTree

### pageRefs

    java.util.ArrayList pageRefs

### pageDics

    java.util.ArrayList pageDics

### resources

    PdfDictionary resources

### form

    PdfDictionary form

### newBookmarks

    protected java.util.List newBookmarks

### closing

    boolean closing

### nd

    Document nd

### tabOrder

    private java.util.HashMap tabOrder

### calculationOrder

    private java.util.ArrayList calculationOrder

### calculationOrderRefs

    private java.util.ArrayList calculationOrderRefs

### widgetKeys

    protected static final java.util.HashMap widgetKeys

### fieldKeys

    protected static final java.util.HashMap fieldKeys

Constructor Detail

### PdfCopyFieldsImp

    PdfCopyFieldsImp(java.io.OutputStream os)
               throws DocumentException,
                      java.io.IOException

Throws:
  `DocumentException`
  `java.io.IOException`

### PdfCopyFieldsImp

    PdfCopyFieldsImp(java.io.OutputStream os,
                     char pdfVersion)
               throws DocumentException,
                      java.io.IOException

Throws:
  `DocumentException`
  `java.io.IOException`

Method Detail

### addDocument

    void addDocument(PdfReader reader,
                     java.util.List pagesToKeep)
               throws DocumentException

  Throws:
    `DocumentException`

### addDocument

    void addDocument(PdfReader reader)
               throws DocumentException

  Throws:
    `DocumentException`

### getCOName

    private static java.lang.String getCOName(PdfReader reader,
                                              PRIndirectReference ref)

### updateCalculationOrder

    private void updateCalculationOrder(PdfReader reader)

### propagate

    void propagate(PdfObject obj,
                   PdfIndirectReference refo,
                   boolean restricted)
             throws java.io.IOException

  Throws:
    `java.io.IOException`

### adjustTabOrder

    private void adjustTabOrder(PdfArray annots,
                                PdfIndirectReference ind,
                                PdfNumber nn)

### branchForm

    protected PdfArray branchForm(java.util.HashMap level,
                                  PdfIndirectReference parent,
                                  java.lang.String fname)
                           throws java.io.IOException

  Throws:
    `java.io.IOException`

### createAcroForms

    protected void createAcroForms()
                            throws java.io.IOException

  Throws:
    `java.io.IOException`

### close

    public void close()

  Description copied from class: `PdfWriter`
  Signals that the `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.

  Specified by:
    `close` in interface `DocListener`
  Overrides:
    `close` in class `PdfWriter`

### closeIt

    protected void closeIt()
                    throws DocumentException,
                           java.io.IOException

  Throws:
    `DocumentException`
    `java.io.IOException`

### addPageOffsetToField

    void addPageOffsetToField(java.util.HashMap fd,
                              int pageOffset)

### createWidgets

    void createWidgets(java.util.ArrayList list,
                       AcroFields.Item item)

### mergeField

    void mergeField(java.lang.String name,
                    AcroFields.Item item)

### mergeWithMaster

    void mergeWithMaster(java.util.HashMap fd)

### mergeFields

    void mergeFields()

### getPageReference

    public PdfIndirectReference getPageReference(int page)

  Description copied from class: `PdfWriter`
  Gets a reference to a page existing or not. If the page does not exist yet the reference will be created in advance. If on closing the document, a page number greater than the total number of pages was requested, an exception is thrown.

  Overrides:
    `getPageReference` in class `PdfWriter`
  Parameters:
    `page` - the page number. The first page is 1
  Returns:
    the reference to the page

### getCatalog

    protected PdfDictionary getCatalog(PdfIndirectReference rootObj)

  Overrides:
    `getCatalog` in class `PdfWriter`

### getNewReference

    protected PdfIndirectReference getNewReference(PRIndirectReference ref)

### getNewObjectNumber

    protected int getNewObjectNumber(PdfReader reader,
                                     int number,
                                     int generation)

  Overrides:
    `getNewObjectNumber` in class `PdfWriter`

### isVisited

    protected boolean isVisited(PdfReader reader,
                                int number,
                                int generation)

### isVisited

    protected boolean isVisited(PRIndirectReference ref)

### setVisited

    protected boolean setVisited(PRIndirectReference ref)

### isPage

    protected boolean isPage(PRIndirectReference ref)

### getReaderFile

    RandomAccessFileOrArray getReaderFile(PdfReader reader)

  Overrides:
    `getReaderFile` in class `PdfWriter`

### setOutlines

    public void setOutlines(java.util.List outlines)

  Sets the bookmarks. The list structure is defined in `SimpleBookmark#`.

  Parameters:
    `outlines` - the bookmarks or `null` to remove any

### openDoc

    public void openDoc()