PrintDocument

KCM Core instructs Microsoft Word to open the Src file to print this file to the specified printer. KCM Core automatically chooses the right processor by inspecting the contents of the Src file. The extension of the Src file is irrelevant. The format of the Src file should be one of the file formats that KCM Core recognizes.

Each processor has its own format for indicating a certain printer. Consequently, KCM Core has a special Printer key for every supported processor. Each of these keys should be used to indicate the printer using the format of the corresponding processor.

After KCM Core has chosen a particular processor, it passes the value of the appropriate printer key to it. If all printer keys are properly set, you can use a single command PrintDocument to print files from all supported processors to a particular printer. If you only need to print Src files of a single processor, you only need to specify the printer key of that particular processor.

Before you can use the word processors in KCM Core, they must be configured.

Syntax

PrintDocument
   Src(<text>)
   File(<text>)
   Copies(<number>)
   Collate (<True or False>)
   TimeOut(<number>)
   WFWPrinter(<text>)
   PDFPrinter(<text>);

Parameters

  • Src: Required. The file that KCM Core prints. Currently, the Microsoft Word and PDF formats are supported.
  • File: Optional. If this parameter is specified, KCM Core prints to a file. The value of the parameter is the name of the resulting spool file. Any existing file is overwritten.
  • Copies: If this parameter is specified, KCM Core requests the word processor to print the specified number of copies in a single print job. The number of copies should not exceed 32767. This parameter is currently only supported for Microsoft Word.
  • Collate: Optional, Word only. (Default setting: False.) This setting only applies when a WFW printer is used (Microsoft Word). This setting allows you to print all pages of a copy before printing the first page of the next copy. Note that not all printer drivers support the Collate printing option of Word; the same can be said about duplex printers.
  • TimeOut: Optional. The timeout for this command in seconds. If the word processor exceeds this timeout, the process is terminated and KCM Core reports a run-time error. If this parameter is omitted, the appropriate default timeout value for either batch or interactive jobs is used. A timeout value of 0 disables the timeout. This feature is currently supported for documents printed using Microsoft Word and PDF documents.
  • WFWPrinter: Optional (Needed if Src is a Microsoft Word document). The name and port of the printer if KCM Core uses Microsoft Word to print Src. If this parameter is not specified, KCM Core uses the value of the constant WFWPrinter. If KCM Core uses Word and this constant is not set, KCM Core reports a run-time error.

    The printer name should be either the name of the printer and its port for local printers, or the name of the printer queue for remote printers.

    Example

    Use the following command to print to the PS printer that is defined locally.

    WFWPrinter("PS on LPT1:")

    Use this command to print to the REMOTE printer queue on SERVER.

    WFWPrinter("\\SERVER\REMOTE") 
    	 

  • PDFPrinter: Optional (needed if SRC is a PDF document). The name of the printer. If this parameter is not specified, KCM Core uses the value of the constant PDFPrinter.

    The printer name should be either the name of the printer for local printers or the name of the printer queue for remote printers.

Limitations and known issues when printing PDF documents:

  • Only supported for PDF documents created with the DocToPDF command for which the Processor parameter value was "Word".
  • Printing large documents (more than a few hundred pages) may lead to resource problems.
  • You cannot print to a file.
  • The collate flag is not supported.
  • Some (embedded) PDF fonts do not print correctly in combination with certain printer driver settings. These problems may arise with PDF documents generated with older versions of KCM Core. If the print shows incorrect glyphs, the following may solve the issue: open the printing preferences of the driver for the account that KCM Core runs in. Click Advanced and clear the following settings under Document Options (if present): Advanced Printing Features and Print Optimizations (typically found on PCL drivers).

Example

Use this command to print to the PS printer that is defined locally.

PDFPrinter("PS")

Use this command to print to the PS printer that is defined remotely.

PDFPrinter("\\SERVER\REMOTE") 
	 

Microsoft Word 2003 compatibility mode

Printing Microsoft Word documents in the DOCX format can cost a significant amount of time when these documents contain graphics. Performance can be improved by forcing Microsoft Word 2010 and higher version to use the Microsoft Word 2003 Compatibility Mode. This mode uses an older version of the graphics engine built in Microsoft Word, which is also used for DOC documents.

KCM Core can be configured to force this compatibility mode by adding the following setting to the [Configuration] section of the dp.ini file:

Word2003CompatibleMode=Y

Forcing the compatibility mode can have an effect on the quality of the graphics and other content of the document. This setting has no effect on Microsoft Word 2007 or older versions. This setting was introduced in KCM Core version 4.2.3.