0

I need to merge several PDF files. What I have is two files, with almost the same name. The name is a code for a product, that consists of the pdf files. One is called 4226469601D.pdf and one is called 4226469601L.pdf. I'm going to have several of these products, and want to create a "automatic batch file" that can merge these files.

The issue is, I need the new file to be called 4226469601.pdf. So it has to take the first 10 numbers in the two files, as the output file. So when I take the next product called 5632987852D.pdf and 5632987852L.pdf the output has to be 5632987852.pdf.

Is this possible?

1
  • Do you need a solution that works on Windows or on another OS?
    – mguassa
    Jul 24, 2015 at 20:22

1 Answer 1

0

You can use pdftk tool to do it

#!/bin/bash

#Use the basename as the filename
filename=211

#Merge Using pdftk
pdftk ${filename}D.pdf ${filename}L.pdf cat output ${filename}.pdf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .