AppendEx, DocAppend

The AppendEx and DocAppend methods append or concatenate a second PDF file to a first one.

 

Syntax

ActiveX:

System.Boolean AppendEx(System.Object Document)

DLL:

int DocAppendEx(EXTDOCHANDLE edhDocument, EXTDOCHANDLE edhSource)

 

Parameters

Document

Object reference of the second PDF file to append to the current one.

edhDocument

Handle Returned by DocOpen.

edhSource

Hold a reference to the source document.

 

Return Value

The return value is True if the AppendEx method succeed. Otherwise, False If the AppendEx method fails.

The return value is zero if the DocAppend method succeed. If the DocAppend method fails, a negative value will returned.

 

Remarks

Check Append Method to append with using its full path.

 

Member of CDIntfEx.Document.

 

Example

Public Sub Sample()

    ' Constants for Activation codes

    Const strLicenseTo As String = "Amyuni PDF Converter Evaluation"

    Const strActivationCode As String = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"

 

    ' Declare a new cdintfex document if it does not exist in the form.

    Dim pdfDoc As New CDIntfEx.Document

    Dim pdfDoc1 As New CDIntfEx.Document

 

    ' 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

    pdfDoc.SetLicenseKey(strLicenseTo, strActivationCode)

    pdfDoc1.SetLicenseKey(strLicenseTo, strActivationCode)

 

    ' Open the document

    pdfDoc.Open("c:\temp\test.pdf")

    pdfDoc1.Open("c:\temp\another.pdf")

 

    ' Append one document to the first one

    pdfDoc.Append(pdfDoc1)

 

    ' Save the document

    pdfDoc.Save("c:\temp\Appended.pdf")

 

End Sub

public void Sample()

{

    // Constants for Activation codes

    const string strLicenseTo = "Amyuni PDF Converter Evaluation";

    const string strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA";

 

    // Declare a new cdintfex document if it does not exist in the form.

    CDIntfEx.Document pdfDoc = new CDIntfEx.Document();

    CDIntfEx.Document pdfDoc1 = new CDIntfEx.Document();

 

    // 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

    pdfDoc.SetLicenseKey(strLicenseTo, strActivationCode);

    pdfDoc1.SetLicenseKey(strLicenseTo, strActivationCode);

 

    // Open the document

    pdfDoc.Open("c:\\temp\\test.pdf");

    pdfDoc1.Open("c:\\temp\\another.pdf");

 

    // Append one document to the first one

    pdfDoc.Append(pdfDoc1);

 

    // Save the document

    pdfDoc.Save(@"c:\temp\Appended.pdf");

 

}

// 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"

 

    // Declare a new cdintfex document if it does not exist in the form.

    EXTDOCHANDLE pdfDoc;

    EXTDOCHANDLE pdfDoc1;

 

    // 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);

 

    // Open the document

    LPBYTE passWord = nullptr;

    DocOpenA(&pdfDoc, "c:\\temp\\test.pdf", passWord);

    DocOpenA(&pdfDoc1, "c:\\temp\\another.pdf", passWord);

 

    // Append one document to the first one

    DocAppend(pdfDoc, pdfDoc1);

 

    // Save the document

    DocSaveA(pdfDoc, "c:\\temp\\Appended.pdf");

 

    // Destroy pdfDoc object

    DocClose(pdfDoc);

    pdfDoc = nullptr;

    DocClose(pdfDoc1);

    pdfDoc1 = NULL;    

 

    return 0;

}

package Example;

 

import com.jacob.activeX.ActiveXComponent;

import com.jacob.com.Dispatch;

import com.jacob.com.Variant;

 

public class Sample {

    public static void main(String[] args)

    {

        // Constants for Activation codes

        String strLicenseTo  = "Amyuni PDF Converter Evaluation";

        String strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA";

 

        // Declare a new cdintfex document if it does not exist in the form.

        ActiveXComponent pdfDoc = new ActiveXComponent("CDIntfEx.Document.6.5"); 

        ActiveXComponent pdfDoc1 = new ActiveXComponent("CDIntfEx.Document.6.5"); 

 

        // 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

        Dispatch.call(pdfDoc, "SetLicenseKey", strLicenseTo, strActivationCode);

 

        // Open the document

        Dispatch.call(pdfDoc, "Open", "c:\\temp\\test.pdf");

        Dispatch.call(pdfDoc1, "Open", "c:\\temp\\another.pdf");

 

        // Append one document to the first one

        Dispatch.call(pdfDoc, pdfDoc1);

 

        // Save the document

        Dispatch.call(pdfDoc, "Save", "c:\\temp\\Appended.pdf");

 

        // Destroy pdfDoc object

        pdfDoc = null; 

        pdfDoc1 = null; 

    }

}

# Constants for Activation codes

$strLicenseTo  =  "Amyuni PDF Converter Evaluation"

$strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"

 

#Declare a new cdintfex document if it does not exist in the form.

$pdfDoc = New-Object -ComObject CDIntfEx.Document.6.5

$pdfDoc1 = New-Object -ComObject CDIntfEx.Document.6.5

 

#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

[System.__ComObject].InvokeMember('SetLicenseKey', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc, @($strLicenseTo, $strActivationCode))

 

#Open the document

[System.__ComObject].InvokeMember('Open', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc,"c:\temp\test.pdf") 

[System.__ComObject].InvokeMember('Open', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc1,"c:\temp\another.pdf") 

 

#Append one document to the first one

[System.__ComObject].InvokeMember('Append', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc,$pdfDoc1) 

 

#Save the document

[System.__ComObject].InvokeMember('Save', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc,"c:\temp\Appended.pdf") 

 

#Destroy pdfDoc object

$pdfDoc = $null

$pdfDoc1 = $null

' Constants for Activation codes

Const strLicenseTo = "Amyuni PDF Converter Evaluation"

Const strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"

 

' Declare a new Document object

Dim pdfDoc

Set pdfDoc = CreateObject("CDIntfEx.Document.6.5")

Dim pdfDoc1

Set pdfDoc1 = CreateObject("CDIntfEx.Document.6.5")

 

' 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

pdfDoc.SetLicenseKey strLicenseTo, strActivationCode

pdfDoc1.SetLicenseKey strLicenseTo, strActivationCode

 

' Open the document

pdfDoc.Open "c:\temp\test.pdf"

pdfDoc1.Open "c:\temp\another.pdf"

 

' Append one document to the first one

pdfDoc.Append pdfDoc1

 

' Save the document

pdfDoc.Save "c:\temp\Appended.pdf"

 

' Destroy pdfDoc object

Set pdfDoc = Nothing

Set pdfDoc1 = Nothing