Q: Are there fuctions for reading and creating article Threads and
Beads in PDFNet?
I didn't found such from API manual, but is it possible to use some
other "low level" functions for these purposes?
--------
A: At the moment, there is no explicit, high-level API for threads and
beads, however if you are familiar with Cos/SDF object model (see
www.pdftron.com/net/faq.html#what_sdf, www.pdftron.com/net/usermanual.html#sdf_objs)
implementing this functionality is as easy as using a high-level API.
For example, the following pseudo-code can be used to traverse all
threads in the document:
// For details regarding 'article' and 'thread' dictionaries, please
// refer to section 8.3.2 'Articles' in the PDF Reference Manual.
// The optional Threads entry in the document catalog holds an array
of thread dictionaries
// C++ code, C#/JAVA versions would be are almost identical.
Obj root = pdfdoc.GetRoot();
Obj threads = root.Find("Threads");
if (threads != NULL) { // pdfdoc has some 'thread' info...
int sz = (int)threads.Size();
for (int i=0; i<sz; ++i) {
Obj th = threads.GetAt(i);
// Get bead info...
Obj bead = th.GetAt(i);
// Get any other information from bead dictionary ...
Rect pos_rect = Rect(bead.Get("R"));
// ...
}
}