PDF-Serialisierung erfolgt jetzt direkt auf Razor Page - Sicherheitsverbesserung
Externer Fetch-Vorgang entfernt, PDF-Inhalt aus Sicherheitsgründen direkt auf der Razor Page serialisiert.
This commit is contained in:
@@ -10,7 +10,7 @@ const ActionType = {
|
||||
}
|
||||
|
||||
class App {
|
||||
constructor(container, envelopeKey, envelopeResponse) {
|
||||
constructor(container, envelopeKey, envelopeResponse, documentBytes) {
|
||||
this.container = container
|
||||
this.envelopeKey = envelopeKey
|
||||
|
||||
@@ -23,6 +23,7 @@ class App {
|
||||
this.currentReceiver = null
|
||||
this.signatureCount = 0
|
||||
this.envelopeResponse = envelopeResponse;
|
||||
this.documentBytes = documentBytes;
|
||||
}
|
||||
|
||||
// This function will be called from the ShowEnvelope.razor page
|
||||
@@ -47,9 +48,11 @@ class App {
|
||||
icon: 'error',
|
||||
})
|
||||
}
|
||||
console.log(documentResponse.data)
|
||||
console.log(this.documentBytes)
|
||||
|
||||
const arrayBuffer = documentResponse.data
|
||||
|
||||
const arrayBuffer = this.documentBytes
|
||||
console.log(arrayBuffer)
|
||||
// Load PSPDFKit
|
||||
this.Instance = await this.UI.loadPSPDFKit(arrayBuffer, this.container)
|
||||
this.UI.configurePSPDFKit(this.Instance, this.handleClick.bind(this))
|
||||
@@ -198,6 +201,7 @@ class App {
|
||||
// Export annotation data and save to database
|
||||
try {
|
||||
const json = await this.Instance.exportInstantJSON()
|
||||
console.log(json)
|
||||
const postEnvelopeResult = await this.Network.postEnvelope(
|
||||
this.envelopeKey,
|
||||
this.currentDocument.id,
|
||||
@@ -236,30 +240,11 @@ class App {
|
||||
.map(a => a.toJS())
|
||||
.filter(a => a.isSignature)
|
||||
|
||||
console.log(annotations.length,"Signatures total!")
|
||||
console.log(filtered.length,"Signatures signed!")
|
||||
|
||||
if (totalSignatures > filtered.length) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
|
||||
/*this.Instance.getFormFields().then(formFields => {
|
||||
formFields.forEach(formField => {
|
||||
console.log(formField.name, formField.toJS());
|
||||
});
|
||||
|
||||
// Filter form fields by type
|
||||
formFields.filter(formField => (
|
||||
formField instanceof PSPDFKit.FormFields.TextFormField
|
||||
));
|
||||
|
||||
// Get the total number of form fields
|
||||
const totalFormFields = formFields.size;
|
||||
|
||||
console.log(totalFormFields)
|
||||
})*/
|
||||
}
|
||||
|
||||
async handleReset(event) {
|
||||
|
||||
Reference in New Issue
Block a user