As we were working on our first SQL Saturday in Slovenia, we came to a point when we had to print out the so-called SpeedPASS's for attendees. This SpeedPASS file is a PDF and contains thier raffle, lunch and admission tickets.
The problem is we have to download one PDF per attendee and print that out. And printing more than 10 docs at once is a pain. So I decided to make a little console app that would merge multiple PDF files into a single file that would be much easier to print. I used an open source PDF manipulation library called iTextSharp version 188.8.131.52
This is a console program I used. It’s brilliantly named MergeSpeedPASS. It only has two methods and is really short. Don't let the name fool you It can be used to merge any PDF files.
The first parameter is the name of the target PDF file that will be created.
The second parameter is the directory containing PDF files to be merged into a single file.
static void Main(string args)
if (args.Length == 0 || args == "-h" || args == "/h")
Console.WriteLine("Welcome to MergeSpeedPASS. Created by Mladen Prajdic. Uses iTextSharp 184.108.40.206.");
Console.WriteLine("Tool to create a single SpeedPASS PDF from all downloaded generated PDFs.");
Console.WriteLine("Example: MergeSpeedPASS.exe targetFileName sourceDir");
Console.WriteLine(" targetFileName = name of the new merged PDF file. Must include .pdf extension.");
Console.WriteLine(" sourceDir = path to the dir containing downloaded attendee SpeedPASS PDFs");
Console.WriteLine(@"Example: MergeSpeedPASS.exe MergedSpeedPASS.pdf d:\Downloads\SQLSaturdaySpeedPASSFiles");
else if (args.Length == 2)
Console.WriteLine("Press any key to exit...");
static void CreateMergedPDF(string targetPDF, string sourceDir)
using (FileStream stream = new FileStream(targetPDF, FileMode.Create))
Document pdfDoc = new Document(PageSize.A4);
PdfCopy pdf = new PdfCopy(pdfDoc, stream);
var files = Directory.GetFiles(sourceDir);
Console.WriteLine("Merging files count: " + files.Length);
int i = 1;
foreach (string file in files)
Console.WriteLine(i + ". Adding: " + file);
if (pdfDoc != null)
Console.WriteLine("SpeedPASS PDF merge complete.");
Hope it helps you and have fun.