Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 27, 2024 18:12
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/6daa64c1653df5f629393cec4bfe1e25 to your computer and use it in GitHub Desktop.
Save bjoerntx/6daa64c1653df5f629393cec4bfe1e25 to your computer and use it in GitHub Desktop.
async saveDocument() {
var documentValidated = TXDocumentViewer.forms.validate();
if (!documentValidated) {
alert('Document is not valid!');
return;
}
const saveSettings = { mergeFormFields: true, embedAnnotations: false };
const result = await TXDocumentViewer.saveDocument(
TXDocumentViewer.StreamType.InternalUnicodeFormat,
saveSettings);
const base64 = await result.base64();
console.log(base64);
this.http.post('/document/saveDocument', { document: base64, name: this.documentData.name }).subscribe(
(result) => {
console.log(result);
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment