B64ToBuff-Funktion zum Konvertieren von Base64-String in ArrayBuffer hinzufügen
This commit is contained in:
parent
0c6fd2efe3
commit
824bf6fb82
@ -71,16 +71,7 @@
|
||||
var envelopeKey = ViewData["EnvelopeKey"] as string;
|
||||
|
||||
<script nonce="@nonce">
|
||||
var base64String = "@Html.Raw(documentBase64String.TrySanitize(_sanitizer))";
|
||||
var byteCharacters = atob(base64String);
|
||||
var byteNumbers = new Array(byteCharacters.length);
|
||||
for (var i = 0; i < byteCharacters.length; i++) {
|
||||
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
}
|
||||
var byteArray = new Uint8Array(byteNumbers);
|
||||
var documentArrayBuffer = byteArray.buffer;
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async () => await new App("@envelopeKey.TrySanitize(_sanitizer)", @Html.Raw(envelopeReceiverJson.TrySanitize(_sanitizer)), documentArrayBuffer, "@ViewData["PSPDFKitLicenseKey"]").init())
|
||||
document.addEventListener("DOMContentLoaded", async () => await new App("@envelopeKey.TrySanitize(_sanitizer)", @Html.Raw(envelopeReceiverJson.TrySanitize(_sanitizer)), B64ToBuff("@Html.Raw(documentBase64String.TrySanitize(_sanitizer))"), "@ViewData["PSPDFKitLicenseKey"]").init())
|
||||
</script>
|
||||
}
|
||||
<div id='app'></div>
|
||||
@ -23,6 +23,7 @@
|
||||
<script src="~/lib/pspdfkit/pspdfkit.js" asp-append-version="true"></script>
|
||||
<script src="~/lib/bootstrap-cookie-consent-settings-main/bootstrap-cookie-consent-settings.js" asp-append-version="true"></script>
|
||||
<script src="~/lib/select2/dist/js/select2.min.js"></script>
|
||||
<script src="~/js/util.js" asp-append-version="true"></script>
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
<main role="main">
|
||||
<partial name="_CookieConsentPartial" />
|
||||
|
||||
1
EnvelopeGenerator.Web/wwwroot/js/util.js
Normal file
1
EnvelopeGenerator.Web/wwwroot/js/util.js
Normal file
@ -0,0 +1 @@
|
||||
const B64ToBuff = (base64String) => new Uint8Array(Array.from(atob(base64String), char => char.charCodeAt(0))).buffer;
|
||||
Loading…
x
Reference in New Issue
Block a user