Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created January 6, 2022 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/962d1bf5743d250b72759cd239e38113 to your computer and use it in GitHub Desktop.
Save bjoerntx/962d1bf5743d250b72759cd239e38113 to your computer and use it in GitHub Desktop.
var TextControl = TextControl || {};
TextControl.saveDocument = function (dotNetObject) {
// save the document on TXTextControl object
TXTextControl.saveDocument(TXTextControl.StreamType.InternalUnicodeFormat, function (document) {
// call the .NET method 'ProcessDocument' with the saved document data
dotNetObject.invokeMethodAsync('ProcessDocument', document.data);
});
};
TextControl.loadDocument = function (document) {
// load the document back into the editor (TXTextControl)
TXTextControl.loadDocument(TXTextControl.StreamType.InternalUnicodeFormat, document);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment