I am a software developer for the company “Sensotec” in Belgium
(Europe) which specializes in the development of software for the
We only work with accessible PDF documents (Fully tagged documents).
At the moment we are developing a program to convert PDF files to a
very specific file format.
The object is to “tag” PDF documents with our tool for a specific
language and reading order.
After a thoroughly search of the sample code and an extensive search
of the SDK, I am unable to find out how I can write an “Element” (eg.
Tag) to the tree structure.
I did a study of the SDF namespace and the code examples on your
website, specifically the example on http://www.pdftron.com/pdfnet/samplecode/LogicalStructureTest.cs
I use a function named “ProcessStructElements()” to loop through all
the SElements and add all of them to a HashTable named “TagHash”.
I am able to add the “ActualText” to (eg. The first element of the
HashTable) like so:
pdftron.PDF.Struct.SElement element =
pdftron.SDF.Obj se = element.GetSDFObj();
se.PutText("ActualText", "This is a test");
Looping through all the elements and modifying them is not the
problem, but is it possible to actually write an element (eg. Tag)
directly to the StructTree ?
For example: writing a string as a contentItem and writing a “Tag” to
the StructTree at the same time ?