MergeFiles

Document manipulation

Description

Merges two files on disk and saves the merged document to a new file. The files are accessed directly on disk, the entire file does not have to be loaded into memory so this function can be used with huge documents. The files must not be encrypted. Monitor the size of the output file while this function runs to work out the progress.

Outlines (bookmarks), form fields and annotations from the both documents will be present in the merged document.

Syntax

Delphi

function TPDFlib.MergeFiles(Const FirstFileName, SecondFileName, OutputFileName: WideString): Integer;

ActiveX

Function PDFlib::MergeFiles(FirstFileName As String, SecondFileName As String, OutputFileName As String) As Long

DLL

int DLMergeFiles(int InstanceID, wchar_t * FirstFileName, wchar_t * SecondFileName, wchar_t * OutputFileName);

Parameters

FirstFileNameThe name of the first file to merge.
SecondFileNameThe name of the second file to merge.
OutputFileNameThe name of the file to create which will contain the merged document.

Return values

0The files could not be merged. Use the LastErrorCode function to determine the cause of the failure.
1The files were merged successfully and the new merged document was created