Joining PDFs is possible with gswin32c.exe
gswin32c.exe -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf
I test GSDLL32.dll same purbose with this small code example.
That callback is not real here.
GSDLL32.dll you can get from here:
http://www.cutepdf.com/Products/CutePDF/writer.aspdownload this:
http://www.cutepdf.com/download/converter.exe#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include "gsdll.h"
#pragma comment(lib, "GSDLL32.lib")
int gsdll_callback(int message, char *str, unsigned long count)
{
return 0;
}
int main(int argc, char **argv)
{
int rc;
#define MAXARGS 10
char *args[MAXARGS] = {0}, szOutFile[260];
int argct = 0;
args[0] = "gsdll32-test.exe";
args[1] = "-dBATCH";
args[2] = "-dNOPAUSE",
args[3] = "-sDEVICE=pdfwrite";
args[4] = szOutFile;
if (argc < 2)
return -1;
strcpy(szOutFile, "-sOutputFile=");
strcat(szOutFile, argv[1]);
for (argct = 5; argct < MAXARGS; ++argct) {
args[argct] = argv[argct-3];
if (args[argct] == NULL) break;
}
rc = gsdll_init(gsdll_callback, NULL, argct, args);
fprintf(stdout,"gsdll_init returns %d\n", rc);
if (!rc) {
rc = gsdll_exit();
}
return 0;
}