class PdfCopyFormsImp extends PdfCopyFieldsImp {

    /**
     * This sets up the output document
     *
     * @param os The Outputstream pointing to the output document
     * @throws DocumentException
     */
    PdfCopyFormsImp(OutputStream os) throws DocumentException {
        super(os);
    }

    /**
     * This method feeds in the source document
     *
     * @param reader The PDF reader containing the source document
     * @throws DocumentException
     */
    public void copyDocumentFields(PdfReader reader) throws DocumentException {<FILL_FUNCTION_BODY>}

    /**
     * This merge fields is slightly different from the mergeFields method of PdfCopyFields.
     */
    void mergeFields() {
        for (AcroFields field : fields) {
            mergeWithMaster(field.getAllFields());
        }
    }

}

        if (!reader.isOpenedWithFullPermissions()) {
            throw new IllegalArgumentException(
                    MessageLocalization.getComposedMessage("pdfreader.not.opened.with.owner.password"));
        }
        if (readers2intrefs.containsKey(reader)) {
            reader = new PdfReader(reader);
        } else {
            if (reader.isTampered()) {
                throw new DocumentException(MessageLocalization.getComposedMessage("the.document.was.reused"));
            }
            reader.consolidateNamedDestinations();
            reader.setTampered(true);
        }
        reader.shuffleSubsetNames();
        readers2intrefs.put(reader, new IntHashtable());
        fields.add(reader.getAcroFields());
        updateCalculationOrder(reader);
    
<methods>public void close() ,public com.lowagie.text.pdf.PdfIndirectReference getPageReference(int) ,public void openDoc() <variables>private final List<java.lang.Object> calculationOrder,private List<java.lang.Object> calculationOrderRefs,boolean closing,protected static final Map<com.lowagie.text.pdf.PdfName,java.lang.Integer> fieldKeys,Map<java.lang.String,java.lang.Object> fieldTree,List<com.lowagie.text.pdf.AcroFields> fields,com.lowagie.text.pdf.RandomAccessFileOrArray file,com.lowagie.text.pdf.PdfDictionary form,private boolean hasSignature,private static final com.lowagie.text.pdf.PdfName iTextTag,com.lowagie.text.Document nd,List<com.lowagie.text.pdf.PdfDictionary> pageDics,List<com.lowagie.text.pdf.PdfIndirectReference> pageRefs,private final Map<com.lowagie.text.pdf.PdfReader,com.lowagie.text.pdf.IntHashtable> pages2intrefs,private final List<com.lowagie.text.pdf.PdfReader> readers,Map<com.lowagie.text.pdf.PdfReader,com.lowagie.text.pdf.IntHashtable> readers2intrefs,com.lowagie.text.pdf.PdfDictionary resources,private Map<com.lowagie.text.pdf.PdfArray,List<java.lang.Integer>> tabOrder,private final Map<com.lowagie.text.pdf.PdfReader,com.lowagie.text.pdf.IntHashtable> visited,protected static final Map<com.lowagie.text.pdf.PdfName,java.lang.Integer> widgetKeys,private static final java.lang.Integer zero