ExportDocToXPS

The ExportDocToXPS command uses the Microsoft Word export filter to produce an XPS file directly from a Microsoft Word document.

This command is only available for Microsoft Word documents and requires Microsoft Office 2007 or higher. This command might also require installation of the optional PDF/XPS add-in if XPS support is not included in the Microsoft Office installation.

The ExportDocToXPS command provides a number of optional parameters affecting the way in which the XPS document is generated. If no optional parameters are provided, KCM Core uses sensible defaults.

You can set a global default for some of the optional parameters in the [Configuration] section of the dp.ini file.

Syntax

ExportDocToXPS
   Src(<text>)
   Dest(<text>)
   OptimiseForPrint(True or False)
   IncludeProperties(True or False)
   ExportBookmarks(<number>)
   BitmapFonts(True or False)
   KeepIRM(True or False)
   AccessibilityInfo(True or False)
   TimeOut(<number>);

Parameters

  • Src: Required. The Microsoft Word document that KCM Core converts to XPS.
  • Dest: Required. The resulting XPS document.
  • OptimiseForPrint: Optional. Indicates if the resulting XPS document should be optimized for printing (True) or for screen reading (False). This parameter defaults to False when omitted, but the default value can be changed using the following setting in the dp.ini file:
    ExportDocToXPS.OptimiseForPrint=(Y or N)
  • IncludeProperties: Optional. Indicates whether some document properties, such as author, title, and so on, from the Microsoft Word document should be copied into the XPS document. This parameter defaults to False when omitted.
  • ExportBookmarks: Optional. Indicates whether a bookmark table should be added to the XPS document.

Supported values are:

  • 0 No bookmarks are generated
  • 1 Bookmarks are generated based on the Heading styles in the Word document
  • 2 Bookmarks are generated based on bookmarks in the Word document

This parameter defaults to 0 when omitted.

BitmapFonts: Optional. If font licenses do not permit a font to be embedded in the XPS document, this setting indicates how the font is handled. True: a bitmap of the text is included in the XPS document. False: the font is referred but not included. Select an appropriate (substitute) font in the printer settings.

This parameter defaults to True when omitted. You can change the default value using the following setting in the dp.ini file.

ExportDocToXPS.FontBitmaps=(Y or N)

KeepIRM: Optional. Indicates whether IRM information should be copied from the Microsoft Word document into the XPS document. This parameter defaults to True when omitted.

AccessibilityInfo: Optional. Indicates whether structure information is embedded in the XPS document to facilitate screen readers.

This parameter defaults to True when omitted.

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 only supported for Microsoft Word.