I'm looking for a way (preferably using the command line on Linux) to merge separate PDFs of book chapters into a single PDF of the book in the correct order (maybe based on the page numbers within the PDFs, or on some heuristics).
So I want to be able to go to the dir containing all the individual chapters and just do
and have the output PDF be in the correct order.
I've found plenty of tools to merge PDFs (
pdftk) but they all put the PDFs in the order that they appear on the command line.
An example list of chapters might be:
1-Introduction.pdf 2-The-analog-digital-interface.pdf 3-Adaptive-digital-systems.pdf 4-Non-linear-applications.pdf 5-Spectral-analysis-and-modulation.pdf 6-Introduction-to-Kalman-filters.pdf 7-Data-compression.pdf 8-Error-correcting-codes.pdf 9-Digital-signal-processors.pdf Appendix-1-Solutions-to-problems.pdf Appendix-2-A-MATLAB-Simulink-primer.pdf Glossary.pdf Index.pdf Preface.pdf References.pdf
But for other books there will be other sections, their names might be different, and even sections with the same name might even be intended to go in different orders. That's why I mentioned that using the page numbers might be the key.