Created
March 27, 2024 18:12
-
-
Save bjoerntx/6daa64c1653df5f629393cec4bfe1e25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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