ui: add logo to spot pdf export
This commit is contained in:
parent
04beacde61
commit
ddb47631b6
2 changed files with 7 additions and 2 deletions
BIN
frontend/app/assets/img/logo-img.png
Normal file
BIN
frontend/app/assets/img/logo-img.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
|
|
@ -42,11 +42,16 @@ export function ChatMsg({
|
|||
|
||||
const onExport = () => {
|
||||
setIsProcessing(true);
|
||||
if (!bodyRef.current) {
|
||||
toast.error('Failed to export message');
|
||||
setIsProcessing(false);
|
||||
return;
|
||||
}
|
||||
import('jspdf')
|
||||
.then(({ jsPDF }) => {
|
||||
const doc = new jsPDF();
|
||||
|
||||
doc.html(bodyRef.current, {
|
||||
doc.addImage('/assets/img/logo-img.png', 80, 3, 30, 5);
|
||||
doc.html(bodyRef.current!, {
|
||||
callback: function (doc) {
|
||||
doc.save('document.pdf');
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue