1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +02:00

Suppression d'éléments avec la touche "Suppr"

This commit is contained in:
Vincent LAURENT 2021-09-20 23:52:43 +02:00
parent 5518669d24
commit 7bd1f99d9c

View File

@ -62,6 +62,20 @@ loadingTask.promise.then(function(pdf) {
})
});
document.addEventListener('keydown', function(event) {
if(event.target.tagName != "BODY") {
return;
}
if(event.key == 'Delete') {
canvasEditions.forEach(function(canvasEdition, index) {
canvasEdition.getActiveObjects().forEach(function(activeObject) {
canvasEdition.remove(activeObject);
});
})
return;
}
});
for(var pageNumber = 1; pageNumber <= pdf.numPages; pageNumber++ ) {
pdf.getPage(pageNumber).then(function(page) {
var scale = 1.5;