iTextSharp.text.pdf.PdfStructTreeController.GetDirectObject C# (CSharp) Метод

GetDirectObject() публичный статический Метод

public static GetDirectObject ( PdfObject obj ) : PdfObject
obj PdfObject
Результат PdfObject
        public static PdfObject GetDirectObject(PdfObject obj)
        {
            if (obj == null)
            return null;
            while (obj.IsIndirect())
            obj = PdfReader.GetPdfObjectRelease(obj);
            return obj;
        }

Usage Example

Пример #1
0
        protected internal void SetReader(PdfReader reader)
        {
            this.reader = reader;
            fileName    = reader.SafeFile.filename;
            if (!openedDocuments.ContainsKey(fileName))
            {
                openedDocuments.Add(fileName, false);
            }
            PdfObject obj = reader.Catalog.Get(PdfName.STRUCTTREEROOT);

            obj = GetDirectObject(obj);
            if ((obj == null) || (!obj.IsDictionary()))
            {
                throw new BadPdfFormatException(MessageLocalization.GetComposedMessage("no.structtreeroot.found"));
            }
            structTreeRoot = (PdfDictionary)obj;
            obj            = PdfStructTreeController.GetDirectObject(structTreeRoot.Get(PdfName.PARENTTREE));
            if (!obj.IsDictionary())
            {
                throw new BadPdfFormatException(MessageLocalization.GetComposedMessage("the.document.does.not.contain.parenttree"));
            }
            parentTree     = (PdfDictionary)obj;
            sourceRoleMap  = null;
            sourceClassMap = null;
        }
All Usage Examples Of iTextSharp.text.pdf.PdfStructTreeController::GetDirectObject