Xbasic

PDF_MERGE Function

Syntax

Result_Flag as L = PDF_Merge(C Base_File ,C Merge_File [,C Result_File [,L flagMergeAllPages [,L flagMergeFileOnTop [,L flagNested [,C pageWidthInPoints [,C pageHeightInPoints]]]]]])

Arguments

Result_Flag

.T. = Merge was successful. .F. = Merge was not successful.

Base_File

The file that receives content from Merge_File.

Merge_File

The content to add to Base_File.

Result_File

Optional. Default = "" (use Base_File). Result_File has the same number of pages as Base_File. If Result_File is blank, then content is merged with Base_File.

flagMergeAllPages

Logical. Optional. Default = .T. If Merge_File has fewer pages than Base_File, flagMergeAllPages controls whether Merge_File pages are repeated so that content is merged onto all pages in Base_File. .T. = Repeat pages. .F. = Do not repeat pages.

flagMergeFileOnTop

Logical. Optional. Default = .F.

flagNested

Logical. Optional. Default = .F. Controls whether the merge is performed in nested mode. Typically left at the default value.

pageWidthInPoints

Optional. Width of the merged document page, in points. If blank, the page width is determined by the largest source document.

pageHeightInPoints

Optional. Height of the merged document page, in points. If blank, the page height is determined by the largest source document.

Description

Merge content of Merge_File with Base_File, creating Result_File. Result_File has the same number of pages as Base_File. If Merge_File has fewer pages than Base_File, flagMergeAllPages controls whether Merge_File pages are repeated so that content is merged onto all pages in Base_File. If Result_File is blank, then content is merged with Base_File. Note: The "logo" or "watermark" file is the Merge_File. The function now also allows you to specify the page size of the merged document. If page size is not specified, the page size of the merged document is determined by the page size of the largest source document.

The PDF_MERGE() function combines Base_File with Merge_File to create Result_File. If Result_File is blank, then content is merged with Base_File. If you are adding a logo or watermark image, it will be the Merge_File. You can optionally control the final page size by specifying pageWidthInPoints and pageHeightInPoints. When these values are omitted, the page size of the merged document is based on the largest source document.

Example

? pdf_merge("c:\inv.pdf", "c:\cus.pdf")
= .T.

See Also