MergeFileList
Document manipulation
Description
Merges all the files in a named file list and saves the resulting merged document to the specified file. Use the ClearFileList, FileListCount and AddToFileList functions to construct the named file list. There must be two or more files in the file list in order for the merging to succeed.
Outlines (bookmarks), form fields and annotations from all the documents will be present in the merged document.
The ordinary merge path alternates temporary output files after the first pair of input files, avoiding an extra full copy of the growing intermediate PDF for each subsequent input. This keeps the existing return-count behaviour while reducing disk I/O on longer file lists.
Syntax
Delphi
Function TPDFlib.MergeFileList(Const ListName, OutputFileName: WideString): Integer;
ActiveX
Function PDFlib::MergeFileList(ListName As String, OutputFileName As String) As Long
DLL
int DLMergeFileList(int InstanceID, const wchar_t * ListName, const wchar_t * OutputFileName);
Parameters
| ListName | The name of the list of files to merge together The path and file name of the file to create which will contain the merged files. |
|---|---|
| OutputFileName |
Return values
The merge reports progress while scanning inputs and writing objects. Calling Abort stops the operation, closes active streams and removes incomplete output. File-list merges open each source for its scan and keep at most the first and current source readers active while writing, so handle usage remains bounded as the list grows
Return values
| The number of documents which were successfully merged together. If this is less than the intended number use the FileListItem function to find the file which caused the merge process to end prematurely. |