I work with Hummus-Recipe library and it's work fine but I want to make a function that accept array of files to append all files to one.
This is my code that work:
const filesRoot = './uploads';
router.route('/')
.get( async (request, response) => {
const src = filesRoot + '/one.pdf';
const appendedFile = filesRoot + '/two.pdf';
const appendedFile2 = filesRoot + '/three.pdf';
const output = filesRoot + '/new.pdf';
const recipe = new HummusRecipe(src, output);
recipe
.appendPage(appendedFile)
.appendPage(appendedFile2)
.endPDF();
});
How can I take this code and make it accept array??
Something like that:
let combinePdfFiles = (array) => {
for (let i = 0; i < array.length; i++) {
}
};
thanks.