Solved

Command line PDF file joiner

Posted on 2013-12-13
6
809 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 51

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 51

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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 51

Expert Comment

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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now