on ‎2024 Aug 23 8:34 AM
Hi Everyone,
I have folder on my system which has n number of images. What I want is to generate a single pdf which contains these images. I have made a service in SAP BAS but what I want is that I will pass my folder path using which the service will generate a single pdf of these images stored in this folder path.
How do i do it using UI5 and CAPM or any other method present in it.
Regards,
Ayush
Request clarification before answering.
Not exactly answering your question but some inspiration:
1. Assuming you have a defined an action such as generatePDF with a parameter for a server side directory
2. In the action implementation you need to be able to read on a the files in the server side directory. Something like:
const testFolder = './tests/';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {
files.forEach(file => {
console.log(file);
});
});Please note that this was stolen from: https://stackoverflow.com/questions/2727167/how-do-you-get-a-list-of-the-names-of-all-files-present-...
2. You need to take each of these files and generate a PDF. Looks like PDFKIT will do the job. See the accepted answer here: https://stackoverflow.com/questions/51054745/how-to-convert-multiple-images-into-single-pdf-using-no...
3. Now you need to return the PDF. Maybe have a look here to see if this helps: https://community.sap.com/t5/technology-blogs-by-members/returning-a-buffer-file-from-cap/ba-p/13495...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.