Page 1 of 1

PptxGenJS and Servoy

PostPosted: Fri Jul 08, 2022 12:46 pm
by swingman
Hi, there is a javascript library called PptxGenJS for creating native PowerPoint presentations.
How would I use this with Servoy?

C

Re: PptxGenJS and Servoy

PostPosted: Mon Jul 11, 2022 4:56 pm
by sbutler
3 options plus an extra I can think of.

1. You build an NGService out of it. Just include the browser version of the JS as a dependency, and then you'll need to build the wrapper calls so Servoy can make the API calls to the component. However, if you do it that way, you're doing it all in the browser, which seems a little odd to me. This is generally the kind of thing you'd want to do server-side IMHO.

2. You take the browser version of the JS, and paste it into a new scope in Servoy, and fiddle with it to get it working. Replacing all the browser/DOM calls with Servoy equivalent calls. This can be a lot of work depending on how much of the Browser DOM API the library is using. Once complete, you could call it and it would make the PDF's server-side that you could then stream to the end user as needed.

3. You take the Node version of the JS lib and build your own little API wrapper around it. So it runs separate from your Servoy solution and you can make API calls to it and have it generate the PDF's for you.

Extra option, consider the Apache POI (with poi-ooxml) Java library that you can just drop into the plugins folder and make Java calls to. https://poi.apache.org/components/slide ... hapes.html
No personal experience with it, but its probably where I'd start.

There are also other java libraries, like those from Aspose, but they are very expensive. They do have a cloud version where you can hit their hosted API and pay per use https://docs.aspose.cloud/slides/add-a- ... sentation/

This one also looked cool and cheaper: https://powerpointgeneratorapi.com/

Re: PptxGenJS and Servoy

PostPosted: Tue Jul 12, 2022 11:14 am
by swingman
Hi Scott,

Thanks for this thorough overview.

I was thinking of doing no. 3, but seeing the https://powerpointgeneratorapi.com/ I will investigate it further, it looks like it will do the job nicely.