Page 1 of 1

Generating PDF with spiderbasic

Posted: Tue Jan 28, 2025 9:44 am
by loulou2522
Has anyone tried to generate PDF with Spiderbasic on the \pbPDFmodule.pbi model or is there another solution?
Thanks in advance

Re: Generating PDF with spiderbasic

Posted: Tue Jan 28, 2025 11:39 am
by plouf
Its unlike to work
You meed js version like jspdf or similar

Re: Generating PDF with spiderbasic

Posted: Wed Jan 29, 2025 1:15 am
by tj1010
I looked at the ~five different JS based libraries and they all look like abandonware, or just had very bad support and documentation..

I still use RTF(Wordpad, LibreOffice>Writer etc..).. Cross-platform, same look and features in 1/8 the time.. The format you can learn in hours on a low level.. It's just not popular and it's old.. The only point PDF gets is most of the readers have toner saver on print.

This works it's jsPDF. Because of CORS you have to self-host the script(https://unpkg.com/jspdf@2.5.2/dist/jspdf.umd.js)

Code: Select all

Procedure MakePDF()
  !require(["/jspdf.umd.js"], ({ jsPDF }) => {
  !  const doc = new jsPDF();
  !  doc.text("Hello world!", 10, 10);
  !  doc.save("a4.pdf");
  !});
EndProcedure
MakePDF()

Re: Generating PDF with spiderbasic

Posted: Wed Jan 29, 2025 11:57 am
by bembulak
Based on a search in the forum, I'd also say jsPDF works. And indeed, I also had used it successfully in the past.

viewtopic.php?t=99

viewtopic.php?p=8364

Can't say what's the current status of jsPDF is though.

Re: Generating PDF with spiderbasic

Posted: Wed Jan 29, 2025 12:10 pm
by Peter
bembulak wrote: Wed Jan 29, 2025 11:57 amviewtopic.php?p=8364
Funnily enough, this thread is from loulou2522 ;)

Re: Generating PDF with spiderbasic

Posted: Thu Jan 30, 2025 1:22 am
by tj1010
I just copy and pasted from the github readme and changed path because CORS. It worked here, and after looking at every single JS PDF library jsPDF seems the most maintained; even though the issues response on github are starting to look like abandonware..

I'm assuming the referenced PB library actually handles the format; never looked at it''s stability and features. jsPDF also does format level generation and seems to have all features.