Q: How do I get the Form XObject? Is it -
Obj forms = rPage.GetResourceDict().FindObj("Form");
If so, once I have the Form(s), how do I get it's iterator?
(I assume that it's possible to have more than 1 form per page.)
Finally, once I have the Form(s), how do get _its_ font dictionary
and
its iterator? Do I treat the Form essentially as if it were a Page?
--------------
A: If you encounter a form XObject element (Element.Type.e_form) you
can use element.GetXObject() to obtain form stream:
Obj xobject = element.GetXObject();
Obj res = xobject.FindObj("Resources");
You can also access form XObjects without using ElementReader to
enumerate all content on the page. For example:
Obj res = page.GetResourceDict();
if (res != null) {
Obj fonts = res.FindObj("Font");
if (fonts != null) {
... now enumerate xobjects in xobjs dictionary ...
for (DictIterator itr = fonts.GetDictIterator(); itr.HasNext();
itr.Next()) {
Font font = new Font(itr.Current());
....
}
}
}
// Process subforms
if (res != null) {
Obj xobjs = res.FindObj("XObject");
if (xobjs != null) {
... now enumerate any sub xobjects ... recursivelly?
for (DictIterator itr = xobjs.GetDictIterator(); itr.HasNext();
itr.Next()) {
....
}
}
}