MergePDF

MergePDF merges the pages of two PDF documents with each other. This command can be used to merge PDF documents to create overlays and watermarks.

Syntax

MergePDF 
   Src(<text>) 
   Watermark(<text>) 
   Dest(<text>)
   Repeat(<True or False>)
   Overlay(<True or False>)
   ProducePDFA(<True or False>)
   Processor("Amyuni" or "PDFLib");

Parameters

  • Src: Required. The full path of the base PDF document.
  • Watermark: Required. The full path of the watermark PDF document. The pages from this document are merged into the Src document either as overlays or as watermarks.
  • Dest: Required. The full path of the resulting PDF document that contains the merged pages. If the source PDF file contains attachments, they are removed from the result PDF file.
  • Repeat: Optional (Default setting: False). This parameter determines how the MergePDF command performs the merge if the Watermark PDF document has fewer pages than the Src PDF document. If the parameter Repeat is set to False, all pages of the Watermark PDF document are merged into corresponding pages of the Src PDF document and the remaining pages of the Src PDF document are copied unmodified. For example, applying the watermark on the first page of a document.
  • If the parameter Repeat is set to True, all pages of the Watermark PDF document are merged into the corresponding pages of the Src PDF document. When the end of the Watermark PDF document is reached, the next page is again merged with the first page of the Watermark PDF document. Sample use 2: Watermark all pages of a document with the same watermark.
  • Overlay: Optional (Default setting: False). This parameter determines how the Src and Watermark PDF documents are merged. If the parameter Overlay is set to False, the pages of the Watermark PDF document are inserted as a watermark, below the text of the Src document. If the parameter Overlay is set to True, the pages of the Watermark PDF document are inserted as an overlay, covering the text of the Src document.
  • ProducePDFA: Optional (Default Setting: False). This parameter determines whether the resulting document is PDF/A-1b compliant.
  • Processor: Optional. Selects the conversion technology used to merge the PDF files. If this parameter is set to "Amyuni", the Amyuni toolkit is used. If this parameter is set to "PDFLib", the PDFLib toolkit is used. Default is "PDFLib". You can change the default through the following setting in the dp.ini file:

    PDFTools.Processor=<"Amyuni" or "PDFLib">

  • InteractiveFeatures: Optional. Takes effect only when theProcessor is set to "PDFLib". This parameter controls how the MergePDF command processes the following interactive PDF features of the input PDF documents:
    • Bookmarks: A PDF file can contain a bookmark structure that follows the document outline. This outline includes entries that link to the corresponding page when clicked.
    • Links: A PDF file can contain links to a particular page within the document or to an external URL.

    InteractiveFeatures parameter does not maintain bookmarks and links that have named destinations.

    This parameter can have three values:

    1. IncludeStrict: Supported interactive features of the input documents are included in the result document. Any issues found with these features are flagged as errors, and processing is stopped. IncludeStrict does not guarantee that the supported interactive features are included in the result document in exactly the same way as they were present in the input documents. However, it attempts to detect and flag issues. When bookmarks or links with named destinations are encountered an error appears.
    2. Include: Supported interactive features of the input documents are included in the result document. The interactive features are replicated as closely to the originals as possible, but any deviations are not flagged as errors. Bookmarks and links with named destinations are not included in the result document.
    3. Exclude: No interactive features of the input document are included in the result document. This option can speed up processing of documents that support a large number of interactive features. Does not include any bookmarks or links, therefore none of them is flagged as an error.

    If the InteractiveFeatures parameter is omitted, you can configure the default behavior of the MergePDF command in dp.ini file. Do this by assigning one of the preceding InteractiveFeatures values to the following setting:

    PDFTools.InteractiveFeatures

    If not specified, the default is include.

Note, that MergePDF command can only produce PDF/A-1b compliant documents if both the Src and Watermark documents are PDF/A-1b compliant and if the parameter ProducePDFA is set to True.

When selecting the conversion technology, note the following:

  • Amyuni
    • MergePDF is only supported if both input documents are produced using DocToPDF with the Processor value set to "Word".
  • PDFLib
    • MergePDF cannot transfer interactive content and document metadata from the documents.
    • As of KCM Core version 5.1.1, hyperlinks and bookmarks are transferred from the input document to the result.