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

If there was no signature at the time of sharing, no signature layer is recorded

This commit is contained in:
Vincent LAURENT 2022-04-02 00:58:35 +02:00
parent ebbad9a7e0
commit 8ae7d12a63
2 changed files with 10 additions and 10 deletions

View File

@ -208,14 +208,12 @@ $f3->route('POST /share',
$f3->error(403); $f3->error(403);
} }
if(!$svgFiles) { if($svgFiles) {
$f3->error(403); shell_exec(sprintf("rsvg-convert -f pdf -o %s %s", $tmpfile.'.svg.pdf', $svgFiles));
} }
shell_exec(sprintf("rsvg-convert -f pdf -o %s %s", $tmpfile.'.svg.pdf', $svgFiles));
if(!$f3->get('DEBUG')) { if(!$f3->get('DEBUG')) {
array_map('unlink', explode(' ', trim($svgFiles))); array_map('unlink', glob($tmpfile."*.svg"));
} }
$f3->reroute('/signature/'.$hash."#informations"); $f3->reroute('/signature/'.$hash."#informations");

View File

@ -763,11 +763,13 @@ var createEventsListener = function() {
if(document.getElementById('save_share')) { if(document.getElementById('save_share')) {
document.getElementById('save_share').addEventListener('click', function(event) { document.getElementById('save_share').addEventListener('click', function(event) {
var dataTransfer = new DataTransfer(); var dataTransfer = new DataTransfer();
canvasEditions.forEach(function(canvasEdition, index) { if(!document.getElementById('save').hasAttribute('disabled')) {
dataTransfer.items.add(new File([canvasEdition.toSVG()], index+'.svg', { canvasEditions.forEach(function(canvasEdition, index) {
type: 'image/svg+xml' dataTransfer.items.add(new File([canvasEdition.toSVG()], index+'.svg', {
})); type: 'image/svg+xml'
}) }));
})
}
document.getElementById('input_svg_share').files = dataTransfer.files; document.getElementById('input_svg_share').files = dataTransfer.files;
}); });
} }