1

I need to use the scissors module to join pdfs...

I have a variable number of files to merge so the code looks like:

var files = [scissors("a.pdf"), scissors("b.pdf")];
scissors.join( *** ).deflate().pdfStream().pipe(fs.createWriteStream(output));

Scissors expect one parameter for each file:

scissors.join(scissors("a.pdf"), scissors("b.pdf"), etc

so how can I do?

0

1 Answer 1

4

You can use Function.prototype.apply:

scissors.join.apply(scissors, files).deflate().pdfStream().pipe(stream);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.