Skip to main content
Skip table of contents

Output parameters (XPS)

setParameter()

IXPSOutput supports several parameters that control how the XPS is written. These can be set in code in two ways. For example, to set the resolution to use if page content requires rendering, the code is:

CPP
IXPSOutputPtr output = IXPSOutput::create(jawsMako);
output->setRenderResolution(300);
C#
IXPSOutput output = IXPSOutput.create(jawsMako);
output.setRenderResolution(300);

The same parameter can be expressed as two strings:

CPP
IXPSOutputPtr output = IXPSOutput::create(jawsMako);
output->setParameter("RenderResolution", "300");
C#
IXPSOutput output = IXPSOutput.create(jawsMako);
output.setParameter("RenderResolution", "300");

This method was added to support scenarios where it is necessary to set an output parameter at runtime, for example in a printer driver where the user is offered options from a menu.

The SDK sample makoconverter allows you to experiment with these parameters by adding them to the command line, for example:

POWERSHELL
makoconverter MyInput.pdf MyOutput.xps MergeAdjacentImages=true

The following settings are supported:

Parameter

Possible values

Description

RenderResolution

1 to 32768

Sets the resolution of page portions that must be rendered. The default is 300dpi.

MergeAdjacentImages

true

false

Set if the XPS output should attempt to merge adjacent images. The default is true.

ColorImageFormat

Auto

JPEG

PNG

TIFF

Set the desired image format for color images that need to be re-encoded for XPS output. The default is eEFAuto.

Note: This is advisory only and may not be honored in all cases if the image cannot be represented in XPS in the desired form.

GrayImageFormat

Auto

JPEG

PNG

TIFF

Set the desired image format for gray images that need to be re-encoded for XPS output. The default is eEFAuto.

Note: This is advisory only and may not be honored in all cases if the image cannot be represented in XPS in the desired form.

MonoImageFormat

Auto

JPEG

PNG

TIFF

Set the desired image format for monochrome images that need to be re-encoded for XPS output. The default is eEFAuto.

Note: This is advisory only and may not be honored in all cases if the image cannot be represented in XPS in the desired form.

JPEGQuality

1 to 5

Sets the JPEG quality to use when compressing images in DCT format. The default is 3 - medium quality.

setRenameFonts

true

false

Uniquely name all fonts used in the XPS produced by Mako, using a prefix of randomly chosen characters.

For use with some XPS consumers that get confused by multiple fonts having the same name.

StripUnicode

true

false

Can only be set with setParameter(), e.g. setParameter("StripUnicode", "true");

When set to true, will remove all Unicode strings from the emitted XPS. Instead, explicit glyph IDs will be used.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.