ui: add logo to spot pdf export

This commit is contained in:
nick-delirium 2025-05-13 16:21:52 +02:00
parent 04beacde61
commit ddb47631b6
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 7 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -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');
},