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])); }
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"); } }
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); }
public ObjectCollection DirectValueAsObjects(ObjectCollection objs) { DictionaryItem di = new DictionaryItem("Direct", DirectValue); return(di.ValueAsObjects(objs)); }