iTextSharp.text.pdf.PdfStamperImp.Close C# (CSharp) Метод

Close() защищенный Метод

protected Close ( PdfIndirectReference info, int skipInfo ) : void
info PdfIndirectReference
skipInfo int
Результат void
        protected virtual void Close(PdfIndirectReference info, int skipInfo)
        {
            try {
                file.ReOpen();
                AlterContents();
                int rootN = ((PRIndirectReference)reader.trailer.Get(PdfName.ROOT)).Number;
                if (append) {
                    int[] keys = marked.GetKeys();
                    for (int k = 0; k < keys.Length; ++k) {
                        int j = keys[k];
                        PdfObject obj = reader.GetPdfObjectRelease(j);
                        if (obj != null && skipInfo != j && j < initialXrefSize) {
                            AddToBody(obj, j, j != rootN);
                        }
                    }
                    for (int k = initialXrefSize; k < reader.XrefSize; ++k) {
                        PdfObject obj = reader.GetPdfObject(k);
                        if (obj != null) {
                            AddToBody(obj, GetNewObjectNumber(reader, k, 0));
                        }
                    }
                } else {
                    for (int k = 1; k < reader.XrefSize; ++k) {
                        PdfObject obj = reader.GetPdfObjectRelease(k);
                        if (obj != null && skipInfo != k) {
                            AddToBody(obj, GetNewObjectNumber(reader, k, 0), k != rootN);
                        }
                    }
                }
            } finally {
                try {
                    file.Close();
                } catch {
                    // empty on purpose
                }
            }
            PdfIndirectReference encryption = null;
            PdfObject fileID = null;
            if (crypto != null) {
                if (append) {
                    encryption = reader.GetCryptoRef();
                } else {
                    PdfIndirectObject encryptionObject = AddToBody(crypto.GetEncryptionDictionary(), false);
                    encryption = encryptionObject.IndirectReference;
                }
                fileID = crypto.FileID;
            } else
                fileID = PdfEncryption.CreateInfoId(PdfEncryption.CreateDocumentId());
            PRIndirectReference iRoot = (PRIndirectReference)reader.trailer.Get(PdfName.ROOT);
            PdfIndirectReference root = new PdfIndirectReference(0, GetNewObjectNumber(reader, iRoot.Number, 0));
            // write the cross-reference table of the body
            body.WriteCrossReferenceTable(os, root, info, encryption, fileID, prevxref);
            if (fullCompression) {
                WriteKeyInfo(os);
                byte[] tmp = GetISOBytes("startxref\n");
                os.Write(tmp, 0, tmp.Length);
                tmp = GetISOBytes(body.Offset.ToString());
                os.Write(tmp, 0, tmp.Length);
                tmp = GetISOBytes("\n%%EOF\n");
                os.Write(tmp, 0, tmp.Length);
            } else {
                PdfTrailer trailer = new PdfTrailer(body.Size,
                body.Offset,
                root,
                info,
                encryption,
                fileID, prevxref);
                trailer.ToPdf(this, os);
            }
            os.Flush();
            if (CloseStream)
                os.Close();
            reader.Close();
        }

Same methods

PdfStamperImp::Close ( String>.IDictionary moreInfo ) : void