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
joinpdf-magic-command *.pdf
and have the output PDF be in the correct order.
I've found plenty of tools to merge PDFs (pdfjoin
, pdftk
) but they all put the PDFs in the order that they appear on the command line.
edit:
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.
convert
can do things like this, though I don't know exactly how it handles you particular case. Try it: install ImageMagick, thenconvert chap1.pdf chap2.pdf chap3.pdf book.pdf
convert
is a crime! It's a crime against sobriety and common sense, because it will mince-meat all nice vector elements from PDF contents into full page raster images. Especially the form of the command you gave -- it will use the default resolution of 72 DPI, loosing lots and lots and lots of the original quality, and throwing away all font information, searchability and accessibility. I can't even...