The AppendEx method can be used to append or concatenate a PDF file to the current document. Whenever possible, it is recommended to call the Append method rather than the AppendEx method. The Append method is usually more efficient.
Sub AppendEx(Document As ACPDFCREACTIVEX.PDFCreactiveX)
void AppendEx(ACPDFCREACTIVEX.PDFCreactiveX Document))
HRESULT AppendEx(IPDFCreactiveX* Document)
Document
Another PDF Creator Control that holds the file to append.
This method uses the PageSequence or PageSecuenceStr attributes from Document Object to determine which pages are going to be appended to the PDF file.
Sub Sample()
' Constants for Activation codes
Const strLicenseTo As String = "Amyuni PDF Creator Evaluation"
Const strActivationCode As String = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC"
' Initializing PDFCreativeX Object
Dim pdf As ACPDFCREACTIVEX.PDFCreactiveX = New ACPDFCREACTIVEX.PDFCreactiveX()
Dim pdf2 As ACPDFCREACTIVEX.PDFCreactiveX = New ACPDFCREACTIVEX.PDFCreactiveX()
' Set license key
pdf.SetLicenseKey(strLicenseTo, strActivationCode)
' Open an existent PDF file
Dim fileName As String = "c:\temp\PDFdocument.pdf"
Dim password As String = ""
pdf.Open(fileName, password)
' Open second PDF file
Dim fileNameToAppend As String = "c:\temp\sample.pdf"
Dim passwordToAppend As String = ""
pdf2.Open(fileNameToAppend, passwordToAppend)
' Append PDF file
pdf.AppendEx(pdf2)
' Save PDF
pdf.Save("c:\temp\CreatePDFDocument_resulting.pdf", ACPDFCREACTIVEX.FileSaveOptionConstants.acFileSaveView)
' destroy objects
pdf = Nothing
End Sub
static void Sample()
{
// Constants for Activation codes
const string strLicenseTo = "Amyuni PDF Creator Evaluation";
const string strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";
// Initializing PDFCreativeX Object
ACPDFCREACTIVEX.PDFCreactiveX pdf = new ACPDFCREACTIVEX.PDFCreactiveX();
ACPDFCREACTIVEX.PDFCreactiveX pdf2 = new ACPDFCREACTIVEX.PDFCreactiveX();
// Set license key
pdf.SetLicenseKey(strLicenseTo, strActivationCode);
// Open an existent PDF file
string fileName = @"c:\temp\PDFdocument.pdf";
string password = "";
pdf.Open(fileName, password);
// Open second PDF file
string fileNameToAppend = @"c:\temp\sample.pdf";
string passwordToAppend = "";
pdf.Open(fileNameToAppend, passwordToAppend);
// Append second PDF file
pdf.AppendEx(pdf2);
// Save PDF
pdf.Save(@"c:\temp\CreatePDFDocument_resulting.pdf", ACPDFCREACTIVEX.FileSaveOptionConstants.acFileSaveView);
// destroy objects
pdf = null;
}
#include <iostream>
#import "c:\users\amyuni\pdfcreactivex.dll" no_namespace
using namespace std;
int main()
{
// Constants for Activation codes
bstr_t strLicenseTo = "Amyuni PDF Creator Evaluation";
bstr_t strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";
// Initialize the COM subsystem
CoInitialize(0);
// IPDFCreactiveXPtr is a smart pointer type defined in pdfcreactivex.tlh,
// the type library header file generated by the #import instruction above
IPDFCreactiveXPtr pdf;
IPDFCreactiveXPtr pdf2;
// Create the PDFCreactiveX instance
pdf.CreateInstance(__uuidof(PDFCreactiveX));
pdf2.CreateInstance(__uuidof(PDFCreactiveX));
// set license key
pdf->SetLicenseKey(_bstr_t(strLicenseTo), _bstr_t(strActivationCode));
// Open an existent PDF file
_bstr_t fileName = "c:\\temp\\PDFdocument.pdf";
_bstr_t password = "";
pdf->Open(fileName, password);
// Open second PDF file
_bstr_t fileNameToAppend = "c:\\temp\\sample.pdf";
_bstr_t passwordToAppend = "";
pdf->Open(fileNameToAppend, passwordToAppend);
// Append second PDF file
pdf->AppendEx(pdf2);
// Save PDF
pdf->Save("c:\\temp\\CreatePDFDocument_resulting.pdf", acFileSaveView);
// destroy objects
pdf = NULL;
Return 0;
}
' FileSaveOptionConstants
Const acFileSaveAll = 0
Const acFileSaveDefault = -1
Const acFileSaveView = 1
Const acFileSaveDesign = 2
Const acFileSavePDFA_7 = 3
Const acFileSavePDFA = 4
Const acFileSavePDF14 = 5
' Constants for Activation codes
Const strLicenseTo = "Amyuni PDF Creator Evaluation"
Const strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC"
' Initializing PDFCreativeX Object
Dim pdf
Set pdf = CreateObject("PDFCreactiveX.PDFCreactiveX.6.5")
Dim pdf2
Set pdf2 = CreateObject("PDFCreactiveX.PDFCreactiveX.6.5")
' Set license key
pdf.SetLicenseKey strLicenseTo, strActivationCode
' Open an existent PDF file
Dim fileName
fileName = "c:\temp\PDFdocument.pdf"
Dim password
password = ""
pdf.Open fileName, password
' Append second PDF file
Dim fileNameToAppend
fileNameToAppend = "c:\temp\sample.pdf"
Dim passwordToAppend
passwordToAppend = ""
pdf2.Open fileNameToAppend, passwordToAppend
' Append PDF file
pdf.AppendEx pdf2
' Save PDF
pdf.Save "c:\temp\CreatePDFDocument_resulting.pdf", acFileSaveView
' destroy objects
Set pdf = Nothing