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);
}
if(!$svgFiles) {
$f3->error(403);
if($svgFiles) {
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')) {
array_map('unlink', explode(' ', trim($svgFiles)));
array_map('unlink', glob($tmpfile."*.svg"));
}
$f3->reroute('/signature/'.$hash."#informations");

View File

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