Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 28, 2024 19:53
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/21a547eb65909a5551134612d549a6dc to your computer and use it in GitHub Desktop.
Save bjoerntx/21a547eb65909a5551134612d549a6dc to your computer and use it in GitHub Desktop.
const load = (contentValue: string) => {
if (TXDocumentViewer) {
// encode the content to base64
contentValue = btoa(contentValue);
// load the document into the viewer
TXDocumentViewer.loadDocument(contentValue, "loaded.html");
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment