Low-code text and image replace in PowerPoint (PPT/PPTX)
I've been wondering for a while how to approach the low code replacement of text and images in PPT. In short, I have a presentation (it's actually one slide) and I want to generate a presentation based on this slide by duplicating it but with the entity data filled in each time - text and image (there are about 10 text fields and 5 orbases to swap). To sum up that this is the template I would like to use to generate a presentation. What's more, in this slide there is also a chart but I have lost hope that I will be able to change the data in it :) I have tried to go about this in many ways, read some forum posts and some blogs. But I have failed Actually it's just a very simple additional functionality to my application in this connection I don't want to pay a few hundred euros for paid add-ons that's why I'm trying to solve this problem by myself but I'm not success to say the least. Most likely I need to use JAVA functions, of course, and there are quite a few of them available for free on the web but I can't use them properly (I'm not familiar with coding in JAVA). I even found something that seems very helpful and it is Free Spire.Presentation for Java from e-iceblue (https://www.e-iceblue.com/Introduce/free-presentation-for-java.html) but I have no elementary idea how to use it. There are examples on the site but I'm so unfamiliar with JAVA that I'm already stuck trying to add these functions to my Mendix application :) (I just don't know how to call them). Of course I downloaded the JAR, used it according to Maven's instructions, added the generated JAR to the userlib folder but to put it bluntly I have no idea what to do next. Even there is a code example for replacing the text using the code from this respository (https://www.e-iceblue.com/Tutorials/Java/Spire.Presentation-for-Java/Program-Guide/Paragraph-and-Text/Replace-Text-in-PowerPoint-in-Java.html) but this example is constructed in such a way that it substitutes the text established directly in the code for another one. And my level of knowledge is such that I have no idea how to pass the data set to be swapped to the function (assuming I could use it at all - which I don't). Moreover, I don't even know how to create a file within microflow and pass it to a JAVA function (the function references a specific file on the user's drive in the example, and I would like the file to be retrieved from an entity) Can you recommend me some sources to handle this and make it as simple as possible without learning JAVA? :) I really don't want to use paid solutions because the application itself is supposed to be free and I believe there is a really simple way even using Apache POI. I will be very much grateful for any help!
I’m afraid if it’s not natively supported in Mendix and you don’t want to ‘learn’ java, it’s gonna be difficult.
First step would be to create a java action containing the placeholders (or a json blob containing the key/value pairs instead of x parameters). The java action will replace the placeholders (although this might not be as straight forward as it may look; I did some experiments with this a while ago (see comment). The java action will create a .java file in your project directory, which you can edit. You’ll need to ‘import’ the necessary ‘jar’ libraries in that file in order to use its contents. Next you’ll have to write java code that actually does the things that you want.
Does it really have to be a ppt/powerpoint slide or can it also be an image (if need be, you can always insert the image intothe powerpoint).
Link for image manipulation: https://www.baeldung.com/java-images
That way you can just insert image x and text y into the image at certain coordinates and you don’t have to mess with placeholders, etc.
So maybe someone can tell me how to use JAVA with Free Spire.Presentation for Java passing parameters from entities as lists instead of data constants?
Or use other JARs to perform this simple operation?
I don't mean step by step instructions but at least a hint where I can look for directions?