iTextSharp.text.pdf.PdfCopy.CopyDictionary C# (CSharp) Метод

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

protected CopyDictionary ( PdfDictionary inp, bool keepStruct, bool directRootKids ) : PdfDictionary
inp PdfDictionary
keepStruct bool
directRootKids bool
Результат PdfDictionary
        protected PdfDictionary CopyDictionary(PdfDictionary inp, bool keepStruct, bool directRootKids)
        {
            PdfDictionary outp = new PdfDictionary();
            PdfObject type = PdfReader.GetPdfObjectRelease(inp.Get(PdfName.TYPE));

             if (keepStruct)
            {
                if ((directRootKids) && (inp.Contains(PdfName.PG)))
                {
                    PdfObject curr = inp;
                    disableIndirects.Add(curr, null);
                    while (parentObjects.ContainsKey(curr) && !(disableIndirects.ContainsKey(curr))) {
                        curr = parentObjects[curr];
                        disableIndirects.Add(curr, null);
                    }
                    return null;
                }

                PdfName structType = inp.GetAsName(PdfName.S);
                structTreeController.AddRole(structType);
                structTreeController.AddClass(inp);
            }

            foreach (PdfName key in inp.Keys) {
                PdfObject value = inp.Get(key);
                if (structTreeController != null && structTreeController.reader != null && (key.Equals(PdfName.STRUCTPARENT) || key.Equals(PdfName.STRUCTPARENTS))) {
                    outp.Put(key, new PdfNumber(currentStructArrayNumber));
                    structTreeController.CopyStructTreeForPage((PdfNumber)value, currentStructArrayNumber++);
                    continue;
                }
                if (type != null && PdfName.PAGE.Equals(type)) {
                    if (!key.Equals(PdfName.B) && !key.Equals(PdfName.PARENT))
                        outp.Put(key, CopyObject(value));
                }
                else {
                    PdfObject res = CopyObject(value, keepStruct, directRootKids);
                    if ((res != null) && !(res is PdfNull))
                        outp.Put(key, res);
                }
            }
            return outp;
        }

Same methods

PdfCopy::CopyDictionary ( PdfDictionary inp ) : PdfDictionary