Solved

Command line PDF file joiner

Posted on 2013-12-13
6
852 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 54

Accepted Solution

by:
Joe Winograd, EE MVE 2015&2016 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 54

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 54

Expert Comment

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

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
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…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

688 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