Exemplo n.º 1
0
        internal IPDFObject GetObject(int index)
        {
            if (index < 0 || index >= _entries.Count)
            {
                return(null);
            }

            Entry entry = _entries[index];

            if (entry == null)
            {
                return(null);
            }

            if (entry.Object != null)
            {
                return(entry.Object);
            }

            if (entry.EntryType == 2)
            {
                parseGenerationEntry(entry);
                if (entry.Object == null)
                {
                    return(entry.Object = new PDFNull());
                }
                return(entry.Object);
            }
            else
            {
                IPDFObject obj = _lexer.ParseEntry(index, entry.Offset, entry.Generation);
                if (obj == null)
                {
                    obj = new PDFNull();
                }

                entry.Object = obj;
                return(obj);
            }
        }