You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to do an autosave with localstorage and it works assigning the key and the value like this:
var pdf = new PDFAnnotate("pdf-container", "my_document.pdf", {
onPageUpdated(page, oldData, newData) {
localStorage.setItem(page, JSON.stringify(newData));
console.log("page "+ page, oldData, newData);
},
and then with a button to load the localstoage but this last one without success, could you guide me on how to achieve this
var canvas = document.getElementById('pdf-container'),
document.getElementById("btnLoad").onclick = function () {
var idt = localStorage.getItem(1) || null;
if (idt !== null) {
var data = JSON.parse(idt);
canvas.putImageData(idt, 0, 0);
}
The text was updated successfully, but these errors were encountered:
I'm trying to do an autosave with localstorage and it works assigning the key and the value like this:
var pdf = new PDFAnnotate("pdf-container", "my_document.pdf", {
onPageUpdated(page, oldData, newData) {
localStorage.setItem(page, JSON.stringify(newData));
console.log("page "+ page, oldData, newData);
},
and then with a button to load the localstoage but this last one without success, could you guide me on how to achieve this
var canvas = document.getElementById('pdf-container'),
document.getElementById("btnLoad").onclick = function () {
var idt = localStorage.getItem(1) || null;
if (idt !== null) {
var data = JSON.parse(idt);
canvas.putImageData(idt, 0, 0);
}
The text was updated successfully, but these errors were encountered: