npm -v
output something akin to X.Y.Z (e.g. 10.5.0)pdf-merger-js
with the following command npm install -g pdf-merger-js
pdf-merge -v
output something akin to X.Y.Z (e.g. 5.1.1)pdf-merge --output ./merged.pdf ./input1.pdf ./input2.pdf
pdf-merge
can merge specific pages or range of pages from a given pdf. For example, let's merge pages 1-2 from the first input with pages 2,3 and 5-7 from the second pdf document:
pdf-merge --output ./merged.pdf ./input1.pdf#1-2 ./input2.pdf#2,3,5-7
pdf-merge
can merge pdf from urls. For example, let's get files and merge the first one with pages 2-3 from the second one:
pdf-merge --verbose --output ./sample.pdf Testfile.pdf https://pdfobject.com/pdf/sample.pdf https://upload.wikimedia.org/wikipedia/commons/1/13/Example.pdf#2-3
Learn more about this tool on npm.js.