cancel
Showing results for 
Search instead for 
Did you mean: 
Brian_Koning
Star Contributor
Star Contributor

The Hyland.Unity.TextDataProvider class is used to obtain a Hyland.Unity.PageData instance containing a textual representation of a document stored in OnBase. The retrieval process used by this data provider automatically converts specific ASCII control characters to other characters so that the resulting PageData contains a visible indication of the control characters presence. One of the control characters handled this way is the form feed ASCII control character. However, with the release of OnBase 14, a developer now has influence over how the text document retrieval process handles form feed characters.

Implementation

The influence over the form feed control characters introduced to the Unity API Developer is exposed as the boolean PreserveFormFeeds property off of the newly created Hyland.Unity.TextGetDocumentProperties class. Instances of this class are passed into the GetDocument() and GetPages() methods of the TextDataProvider class.

The PreserveFormFeeds property explicitly controls whether the returned text document PageData retains the form feed control characters from the original document (PreserveFormFeeds == true) or if they are implicitly converted to the newline and carriage return control characters (PreserveFormFeeds == false). The new default behavior, and standard behavior up until the release of OnBase 14, converted the form feed control characters.

Example

The TextGetDocumentProperties class used with the TextDataProvider is a newly exposed class similar in intent to the Hyland.Unity.PDFGetDocumentProperties class used with the Hyland.Unity.PDFDataProvider class. These classes are essentially strongly typed property bags controlling the retrieval process for a particular data provider.

The new functionality can be leveraged by setting the newly exposed property PreserveFormFeeds to true and passing in the properties to the TextDataProvider:

using Hyland.Unity;// Application app;// Document document;TextGetDocumentProperties properties = app.Core.Retrieval.Text.CreateTextGetDocumentProperties();properties.PreserveFormFeeds = true;PageData pageData = app.Core.Retrieval.Text.GetDocument(document.DefaultRenditionOfLatestRevision, properties);

After execution, the pageData variable contains a text document which has the form feed control characters existing in the original text document preserved in the resulting retrieved PageData instance.

Specifics

The newly created functionality controlled by the PreserveFormFeeds property does not require a change in any existing licensing - it is available to any Developer which can use the Unity API in a Unity Script or custom application context.

Conclusion

The Unity API has extended the level of control granted to Developers with retrieving text documents with form feed ASCII control characters in OnBase 14. A new property bag class, TextGetDocumentProperties, and a new boolean property, PreserveFormFeeds, has been exposed for consumption with the existing TextDataProvider class.

Be sure to leave any questions or comments you might have below in the comments section below. We'll be checking out notes and annotations in PDF documents next time.