1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +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

@ -17,6 +17,11 @@ loadingTask.promise.then(function(pdf) {
var canvasEditions = []; var canvasEditions = [];
var svgCollections = []; 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) { opentype.load('/vendor/fonts/Caveat-Regular.ttf', function(err, font) {
fontCaveat = font; fontCaveat = font;
}); });
@ -69,8 +74,8 @@ loadingTask.promise.then(function(pdf) {
svgCollections.push(document.getElementById('img-upload').src); svgCollections.push(document.getElementById('img-upload').src);
} }
displaysSVG(); displaysSVG();
document.querySelector('#svg_list label:last-child').click(); document.querySelector('#svg_list label:last-child').click();
localStorage.setItem('svgCollections', JSON.stringify(svgCollections));
}); });
function dataURLtoBlob(dataurl) { function dataURLtoBlob(dataurl) {