AttachFilesToPDF

Use this command to add one or more files as attachments to a PDF file.

Syntax

AttachFilesToPDF 
	Src (<text>) 
	Dest (<text>) 
	Attachments (<text>) 
	TimeOut (<number>); 

Parameters

  • Src: Required. Source PDF file.
  • Dest: Required. Result PDF file containing the source PDF with the attached files.
  • Attachments: Required. One or more file names, separated by commas. You can override the name of the attachment by adding a prefix [name] to the attachment file name. Verify that the file name refers to an existing file.
  • TimeOut: Optional. Timeout for this command in seconds. If it is exceeded, the process is terminated and KCM Core reports a run-time error. To disable the timeout, set this parameter to 0 or omit it.
  • InteractiveFeatures: Deprecated. All interactive features are always included into the document. If this parameter is specified, it is ignored.

If the source PDF file already contains attachments, they are not removed from the result PDF file.

Example

Const Text src = "letter" [ _sessionDir, "pdf" ];
Const Text dest = "extended_letter" [ _sessionDir, "pdf" ];

AttachFilesToPDF
 Src (src)
 Dest (dest)
 Attachments ("c:\documents\policy.docx,
  [Terms and Conditions.docx] c:\documents\tac.docx");

In this example, a PDF document named extended_letter is created for the source PDF document named letter and gets the following DOCX attachments: policy and Terms and Conditions. The source document for Terms and Conditions is the tac.docx file. The original file name is overridden by the prefix [Terms and Conditions.docx].