I need to join multiple pdf files into a single page pdf. I need to stitch together some PDFs that I generate. If I am stitching horizontally, all of the PDFs are the same height but not the same width. When I am stitching vertically, all of the PDFs are the same width but not the same height.
I found lots of answers saying to do this with pdfjam/pdfnup. I tried that, but it seems that is only for when each item to be joined is the same dimension, or else I just can't get it to work right.
I would really prefer to do this in ghostscript, since the rest of my PDF manipulation is already done in ghostscript. I haven't found a solution for that though.
As an example, the items I am stitching together look pretty much like this:
┌---------------------------------------┐
┬-┬----------------┬-┬----------------┬-┬
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
┴-┴----------------┴-┴----------------┴-┴
└---------------------------------------┘
I am first trying to join the 5 boxes that form the center section horizontally. Then I need to join that with the boxes above and below it.