1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-05-29 03:52:31 +02:00

Stockage des élément de signature dans le localstorage

This commit is contained in:
Vincent LAURENT 2021-09-25 16:48:41 +02:00
parent 9ef0c003e8
commit 9ba7fee244

View file

@ -16,6 +16,11 @@ loadingTask.promise.then(function(pdf) {
var activeCanvasPointer = null;
var canvasEditions = [];
var svgCollections = [];
if(localStorage.getItem('svgCollections')) {
svgCollections = JSON.parse(localStorage.getItem('svgCollections'));
console.log(svgCollections);
}
opentype.load('/vendor/fonts/Caveat-Regular.ttf', function(err, font) {
fontCaveat = font;
@ -69,8 +74,8 @@ loadingTask.promise.then(function(pdf) {
svgCollections.push(document.getElementById('img-upload').src);
}
displaysSVG();
document.querySelector('#svg_list label:last-child').click();
localStorage.setItem('svgCollections', JSON.stringify(svgCollections));
});
function dataURLtoBlob(dataurl) {