Solved

Command line PDF file joiner

Posted on 2013-12-13
6
823 Views
Last Modified: 2014-01-02
I have several pdf files at C:\PDF\.
I need to join them all based on the order that they start in.. ie 1.pdf, 2.pdf, 3.pdf, 4.pdf.

I need to launch a batch script, which will look into this folder and then join all the files together and create a new file called Joined.pdf.
0
Comment
Question by:100questions
  • 3
  • 3
6 Comments
 
LVL 52

Accepted Solution

by:
Joe Winograd, EE MVE earned 500 total points
ID: 39717833
The PDF Toolkit (PDFtk) is an excellent (free!) product that has numerous features to manipulate PDFs. It comes in both command line and GUI versions. The command line version is called PDFtk Server and may be downloaded here:
http://www.pdflabs.com/tools/pdftk-server/

Don't be misled by "Server" in the name. I don't know why they called it that, but it's just an executable (pdftk.exe, with a supporting DLL, libiconv2.dll) that runs on XP, Vista, W7, and W8 (it does not have to run on a "server" OS...it also runs on Mac, but I've never used it on that).

Here's the one line solution for what you want to do:

pdftk C:\PDF\*.pdf cat output C:\OutputFolder\Joined.pdf

The "cat" operation "catenates" (merges/combines/joins) all of the input PDF files (*.PDF) and puts the "catenated" PDF in the file following the "output" parameter.

The only issue for you may be the order of the documents, in which case you could place the call to PDFtk inside a loop in a script or batch file. Regards, Joe
0
 

Author Comment

by:100questions
ID: 39718690
How well known is PDFtk server? And have third parties checked the software for spyware etc.? The solution I am looking for will be used in a business environment.
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 39718816
I don't know if any third parties have checked it. I did some web research years ago before I first used it (the product has been around since 2004) and the research did not uncover any issues. At the time I was using Norton A-V and it came up clean then. I just ran a scan on the two binaries (pdftk.exe and libiconv2.dll) and they came up clean on both Malwarebytes and MSE (both with the latest updates). I feel confident of it, but, of course, it's your decision.

Btw, since it will be used in a business environment, you need to look at the licensing requirements. It is free for personal use, and I think it is free for business use (I'm not sure about that), but I know it is not free for redistribution, if that's what your business intends. Here's a quote from their site:
It is also used by OEMs and ISVs to give their products the ability to manipulate PDFs. A commercial license is required to distribute PDFtk with your commercial product.
Also, even if you're not redistributing it, but still using it in a business environment, you should consider getting commercial support for it, also not free. From the site:
For commercial product support, please purchase our one-year support agreement. It entitles you to the fastest answers to your questions and the fastest fixes to any problems that arise.
The full support agreement is here:
http://www.pdflabs.com/docs/pdftk-license/pdf_labs_pdftk_redist_lic_agreement_ver_2.0.pdf

Regards, Joe
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:100questions
ID: 39719477
Thanks.  Does anyone else have any suggestions, which uses a free script or VB Script.
0
 

Author Closing Comment

by:100questions
ID: 39751404
PDFTKserver works.
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 39751438
Glad to hear it! Regards, Joe
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question