[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Command line PDF file joiner

Posted on 2013-12-13
6
Medium Priority
?
906 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 57

Accepted Solution

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

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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise 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 57

Expert Comment

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

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

873 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