Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 3f83308

Browse files
author
hhurz
committed
Call onAfterSaveToFile when exporting tp pdf
1 parent f82eb2e commit 3f83308

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tableExport.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,11 +1742,16 @@
17421742
return;
17431743
}
17441744

1745+
const fileName = defaults.fileName + '.pdf';
1746+
17451747
try {
17461748
const blob = doc.output('blob')
1747-
saveAs(blob, defaults.fileName + '.pdf');
1749+
saveAs(blob, fileName);
1750+
1751+
if (typeof defaults.onAfterSaveToFile === 'function')
1752+
defaults.onAfterSaveToFile(blob, fileName);
17481753
} catch (e) {
1749-
downloadFile(defaults.fileName + '.pdf',
1754+
downloadFile(fileName,
17501755
'data:application/pdf' + (hasimages ? '' : ';base64') + ',',
17511756
hasimages ? doc.output('blob') : doc.output());
17521757
}

0 commit comments

Comments
 (0)