Esempio n. 1
0
        public Object ValueAsObject(ObjectCollection objs)
        {
            if (!Valid)
            {
                return(new Object());
            }

            if (m_objects.Count == 0)
            {
                return(new Object());
            }

            if (m_objects.Count != 1)
            {
                return(new Object());
            }
            return(objs.Get(m_objects[0]));
        }
Esempio n. 2
0
        public Content(Pdf Document, Object PageObject)
        {
            if (PageObject.Number == -1)
            {
                throw new RuntimeException("Page object is invalid");
            }

            DictionaryItem di = PageObject.Dictionary.Get("Contents");

            if (!di.Valid)
            {
                throw new RuntimeException("Page object does not refer to a content object");
            }

            m_objects = di.ValueAsObjects(Document.Objects);
            if (m_objects.Count == 0)
            {
                throw new RuntimeException("Page object " + PageObject.Number + " " + PageObject.Generation +
                                           " does not refer to a content object which is valid");
            }
        }
Esempio n. 3
0
        public ObjectCollection ValueAsObjects(ObjectCollection objs)
        {
            if (!Valid)
            {
                return(new ObjectCollection());
            }

            if (m_objects.Count == 0)
            {
                throw new RuntimeException("There are no objects to return");
            }

            ObjectCollection oc = new ObjectCollection();

            foreach (ObjectReference or in m_objects)
            {
                oc.Add(objs.Get(or));
            }

            return(oc);
        }
Esempio n. 4
0
        public ObjectCollection DirectValueAsObjects(ObjectCollection objs)
        {
            DictionaryItem di = new DictionaryItem("Direct", DirectValue);

            return(di.ValueAsObjects(objs));
        }