Using Microsoft Word

The Word PDF generation engine and Amyuni printer driver use Word to layout all graphics. As a result, this engine produces PDF output that resembles the layout as shown in the Word application. In addition this engine supports:

  • Generation of PDF/X files
  • Generatio of textual watermarks on each page
  • Generation of linearized PDF files
  • Conversion of both DOC and DOCX files . Note that the DOC format has been deprecated in KCM 5.7.0.

The main disadvantages of this technology are:

  • It requires the installation of MS Word on the server that executes DocToPDF.
  • It can only generate PDF/A files that adhere to the 1b conformance level. This level of conformance doesn't support transparency, therefore the output may slightly differ from the source.
  • It doesn't support named links. If your source document contains links, they must be explicitly defined in https://... format to create working links in the resulting PDF.
  • The conversion speed is slower compared to the Rendition engine.

The following parameters can be used to control PDF generation:

Parameter

Required/Optional

Description

WaterMarkText Optional

Produces a text as a watermark on every page. When omitted, no watermark is included.

WaterMarkFont Optional

The font for the watermark text. When omitted the CourierNew font is used.

WaterMarkSize Optional

The font size for the watermark text. This parameter can be expressed in inches ("<n>;inch") or centimeters ("<n>;cm"). When omitted a 0.5 inch ("0.5;inch") font size is used.

WaterMarkColour Optional

The color of the watermark in BGR (blue-green-red). This value must be expressed in the hexadecimal format 0xBBGGRR where BB represents the blue component of the color, GG the green component and RR the red component. When omitted, the watermark with the color gray (0x808080) is used.

WaterMarkPosition Optional

The position of the watermark relative to the upper left corner of the page. The position can be specified in inches ("<x>;<y>;inch") or centimeters ("<x>;<y>;cm"). When omitted, the watermark is anchored to the upper left corner of the document.

WaterMarkAngle Optional

The angle the watermark is rotated. When omitted, the watermark is not rotated.

WaterMarkForeground Optional

When set to True, the watermark is positioned over the content of the page. When omitted or set to False, the watermark is placed under the content.

EmbedFonts Optional

If this parameter is set to True, the conversion process embeds all non-standard PostScript fonts. This parameter is by default set to False.

The default can be changed to True through the following setting in the dp.ini file: DocToPDF.EmbedFonts=Y

EmbedFullFonts Optional

If this parameter is set to False, only a subset containing the characters actually used in the document is embedded.

Otherwise full fonts are embedded. This parameter is by default set to False.

The default can be changed to True through the following setting in the dp.ini file: DocToPDF.EmbedFullFonts=Y

This parameter is ignored when the EmbedFonts setting is disabled.
EmbedStandardFonts Optional

If this parameter is set to True, standard PDF fonts are embedded in the PDF file.

This parameter is by default set to False. The default can be changed to True through the following setting in the dp.ini file: DocToPDF.EmbedStandardFonts=Y

This parameter only has effect when the MultiLingual setting has been disabled. If the MultiLingual setting is enabled, standard PDF fonts are always embedded.

EmbedLicensedFonts Optional

If this parameter is set to True, licensed fonts are embedded in the PDF file.

This parameter is by default set to False. The default can be changed to True through the following setting in the dp.ini file: DocToPDF.EmbedLicensedFonts=Y

WebOptimise Optional

If this parameter is set to True, a Web Optimized (linearized) PDF is produced.

This parameter is by default set to False. The default can be changed to True through the following setting in the dp.ini file: DocToPDF.WebOptimise=Y.

When this option is set to True, Microsoft Word ignores the ProducePDFA parameter. The resulting PDF file is not PDF/A-1b compliant.
ContentCompression Optional

If this parameter is set to False, the content of the PDF file is not compressed.

This parameter is by default set to True. The default can be changed to False through the following setting in the dp.ini file: DocToPDF.ContentCompression=N.

AutomaticImageCompression Optional

If this parameter is set to False, images are embedded using a combination of run-length encoding and compression using a compression method selected based on the characteristics of the image.

This parameter is by default set to True.

JPEGCompression Optional

Specifies the compression rate for 24-bit images. Values indicate trade-off between size and quality, and must be in the range from 0 (no compression) to 9 (high compression, low quality).

We recommend you to use a single value, or only switch between the values 0, 1, 3 or 8. Switching to or from one of the other values will cause significant overhead.

This parameter is by default set to 0 (no compression).

This setting is ignored when AutomaticImageCompression is True.

CCITTCompression Optional

If this setting is set to True, black and white images are compressed using CCITT compression.

This parameter is by default set to False.

Image256ColourReduction Optional

If this setting is set to True, all images are reduced to a 256-color palette. This can cause a significant loss of quality in 24-bit images.

This parameter is by default set to False.

This setting is ignored when AutomaticImageCompression is True.

GreyScale Optional

If this parameter is set to True, all color in the document is dithered to grayscale.

This parameter is by default set to False.

DPI Optional

Overrides the default resolution used for positioning text and downsampling images. When using Microsoft Word, the supported resolutions are limited to 72, 150, 300, 600 and 1200 DPI.

This parameter is by default set to 300 DPI.

The default can be changed to another resolution through the following setting in the dp.ini file: DocToPDF.DPI=<resolution>.

ProducePDFX Optional

If set to True, the result document is PDF/X-3 compliant. This parameter is by default set to False.

The default can be changed to True through the following setting in the dp.ini file: DocToPDF.ExportPDFX=Y.

Enabling the PDF/X support also enables Image Compression.

ColorProfile Optional

The color profile file used for PDF/X creation. The color profile can be either the name of the profile with the extension, such as AmyuniCMYK.icc, if the color profile is already installed on the system, or the full path to where the profile is located.

There is no default value for this setting. A default color profile can be set through the following setting in the dp.ini file: DocToPDF.ColorProfile=<colorprofile>.

A valid color profile is required to produce PDF/X documents. Color profiles are not supported for non-PDF/X documents.

Word-specific DocToPDF syntax:

DocToPDF
   Src(<text>)
   Dest(<text>)
   TimeOut(<text>)
   ProducePDFA (True or False)
   DPI (<number>)
   Processor("Word" or "Rendition")
   EmbedFonts(True or False)
   EmbedFullFonts(True or False)
   EmbedStandardFonts(True or False)
   EmbedLicensedFonts(True or False)
   WaterMarkText(<text>)
   WaterMarkFont(<text>)
   WaterMarkSize(<text>)
   WaterMarkColour(<number>)
   WaterMarkPosition(<text>)
   WaterMarkAngle(<number>)
   WaterMarkForeground(True or False)
   WebOptimise(True or False)
   ContentCompression(True or False)
   JPEGCompression(<number>)
   CCITTCompression(True or False)
   AutomaticImageCompression(True or False)
   Image256ColourReduction(True or False)
   GreyScale(True or False)
   DPI (<number>)
   ProducePDFX (True or False)
   ColorProfile (<text>)

The defaults for some of these parameters can be controlled in the dp.ini file as follows:

  • DocToPDF.EmbedFonts
  • DocToPDF.EmbedFullFonts
  • DocToPDF.EmbedStandardFonts
  • DocToPDF.EmbedLicensedFonts
  • DocToPDF.WebOptimise
  • DocToPDF.ContentCompession
  • DocToPDF.ExportPDFX
  • DocToPDF.ColorProfile
  • DocToPDF.DPI

Additionally, the Word processor takes into account a number of global settings that can be specified in the dp.ini file:

Parameter Description
DocToPDF.PaperSize

Sets the default paper size. Normally, this setting does not need to be specified, as the paper size is derived from the source document.

DocToPDF.PaperSize=<"A4", "A3", "Letter", or "Legal">

If not set, the paper size defaults to A4.

DocToPDF.Orientation

Sets the default paper orientation. Possible values are Landscape and Portrait.

DocToPDF.Orientation=<"Portrait" or "Landscape">

If not set, the orientation defaults to Portrait.

DocToPDF.MultiLingual

Set to N to turn off multilanguage support. Multilanguage support is needed to support non-western and special character sets, and gives the most portable documents in practice. This setting should be turned on to avoid problems with missing characters in the output. This setting is often required when the output contains currency symbols such as the euro sign (€). Turning off multilingual support may result in smaller files.

If not set, it defaults to Y. Note that if multilingual support is on, most font embedding parameters have no effect. In that case, all fonts, including the standard fonts but with the exception of licensed fonts, are embedded as a subset.

DocToPDF.MultiLingual=<Y or N>

DocToPDF.HorizontalMargin

Sets the horizontal printer margins (in mm). The printer margin defines the area that contains graphical data. The area outside the margin stays blank. Normally, this setting does not need to be specified, as the default allows the entire page to be used.

DocToPDF.HorizontalMargin=<number>

If not set, it defaults to zero.

DocToPDF.VerticalMargin

Sets the vertical printer margins (in mm). The printer margin defines the area that contains graphical data. The area outside the margin stays blank. Normally, this setting does not need to be specified, as the default allows the entire page to be used.

DocToPDF.VerticalMargin=<number>

If not set, it defaults to zero.

DocToPDF.SimPostscript

Set to Y to enable Postscript simulation, or N to disable. This option changes how the Amyuni PDF printer driver presents itself to the word processor application. This option is needed when using transparent backgrounds or watermarks in Microsoft Word.

DocToPDF.SimPostscript=<Y or N>

Configuration and performance

The KCM Core services must be running with local or domain credentials for the DocToPDF command to function correctly. Running the services with Local System credentials is not supported.

Some of the configuration parameters are applied to the Amyuni printer driver when it is loaded during startup. Some non-default parameter values can require a reload of the printer driver which has a performance penalty.

The Amyuni printer driver requires Microsoft Word to start printing within a certain time frame after opening the document. In case of a delay from the Microsoft Word side, an error is generated. To resolve the issue, use one of these workarounds.

  • Simplify the constructs used in the document. Some constructs can produce more complex documents than the others, and such documents can take a significant amount of time (even several minutes) for Microsoft Word to print or even open them.
  • Use either ExportDocToPDF or Rendition to convert the document.

Microsoft Word 2003 compatibility mode

Converting Microsoft Word documents can cost a significant amount of time when these documents contain graphics. Performance can be improved by forcing Microsoft Word 2010 and later versions 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.