The ConcatenateFiles function appends or concatenates a second PDF file to a first one.
BOOL ConcatenateFiles(LPCSTR file1, LPCSTR file2, LPCSTR file3)
file1
Full path of the first file.
file2
Full path of the second file to be appended to file1.
file3
Full path of the destination or output file.
The return value is True if the files were appended, False if an error occurred appending files.
This function is not guaranteed to process files created from PDF generation tools other than the Amyuni PDF Converter, or Amyuni PDF Creator. It will however work with files coming from most applications.
// PDF Converter Cpp.cpp : Defines the entry point for the console application.
//
#include <Windows.h>
#include <string>
#include <iostream>
#include "CdIntf.h"
#pragma comment (lib, "CDIntf.lib")
using namespace std;
int main()
{
// Constants for Activation codes
#define strLicenseTo "Amyuni PDF Converter Evaluation"
#define strActivationCode "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"
// The SetLicenseKey method should be called after creating an object of type
// CDIntfEx.Document to activate the advanced methods that require the object
// activation code to work properly
SetLicenseKeyA(strLicenseTo, strActivationCode);
// Concatenate the Documents
ConcatenateFiles( "c:\\temp\\test1.pdf", "c:\\temp\\test2.pdf", "c:\\temp\\appended.pdf" );
return 0;
}