I would like to get a script able to to merge many PDF (but 2 by 2) into a single pdf from a list (XLS, TXT, CSV...) like this one :
path1/input_file1.pdf;path2/input_file2.pdf;path3/output_file1.pdf
...
...
...
path100/input_file100.pdf;path200/input_file200.pdf;path300/output_file100.pdf
With this list I would like 100 pdf files in output : input_file1.pdf + input_file2.pdf = output_file1.pdf ... input_file100.pdf + input_file200.pdf = output_file100.pdf
Option : it would be great if it's possible to sometimes have only one PDF in input (in this case output = input) :
path1/input_file1.pdf;;path3/output_file1.pdf
or
;path2/input_file2.pdf;path3/output_file1.pdf
I think using Python can be a good way to do that, maybe with pdfrw library
Thanks for your help,
Maxence
@ @Patrick Maupin : do you have any idea ?
A PyMuPDF solution:
If you need to join non-PDF files, you must first open the file as a document, then convert it to a PDF, and then join it. There are about a dozen of other filetypes supported as a PyMuPDF-Document, but XLS, CSV, DOCX, TXT are not among them: those must be converted to PDF first by some other means.
Among supported document types are XPS, EPUB, MOBI plus about 10 image formats. Here is the adjusted code:
PS: I do not think you will find a faster package for this task ...