iTextSharp.text.pdf.PdfArray.GetAsDict C# (CSharp) Метод

GetAsDict() публичный Метод

public GetAsDict ( int idx ) : PdfDictionary
idx int
Результат PdfDictionary
    public PdfDictionary GetAsDict(int idx) {
        PdfDictionary dict = null;
        PdfObject orig = GetDirectObject(idx);
        if (orig != null && orig.IsDictionary())
            dict = (PdfDictionary) orig;
        return dict;
    }
    

Usage Example

Пример #1
0
        private void NodeProcess(PdfDictionary struc, PdfIndirectReference reference)
        {
            PdfObject obj = struc.Get(PdfName.K);

            if (obj != null && obj.IsArray())
            {
                PdfArray ar = (PdfArray)obj;
                for (int k = 0; k < ar.Size; ++k)
                {
                    PdfDictionary dictionary = ar.GetAsDict(k);
                    if (dictionary == null)
                    {
                        continue;
                    }
                    if (!PdfName.STRUCTELEM.Equals(dictionary.Get(PdfName.TYPE)))
                    {
                        continue;
                    }
                    if (ar.GetPdfObject(k) is PdfStructureElement)
                    {
                        PdfStructureElement e = (PdfStructureElement)dictionary;
                        ar.Set(k, e.Reference);
                        NodeProcess(e, e.Reference);
                    }
                }
            }
            if (reference != null)
            {
                writer.AddToBody(struc, reference);
            }
        }
All Usage Examples Of iTextSharp.text.pdf.PdfArray::GetAsDict