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
|
C#
|
The same parameter can be expressed as two strings:
CPP
|
C#
|
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:
makoconverter MyInput.pdf MyOutput.xps MergeAdjacentImages=true
The following settings are supported:
Parameter | Possible values | Description |
---|---|---|
RenderResolution |
| Sets the resolution of page portions that must be rendered. The default is 300dpi. |
MergeAdjacentImages |
| Set if the XPS output should attempt to merge adjacent images. The default is |
ColorImageFormat |
| Set the desired image format for color images that need to be re-encoded for XPS output. The default is 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 |
| Set the desired image format for gray images that need to be re-encoded for XPS output. The default is 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 |
| Set the desired image format for monochrome images that need to be re-encoded for XPS output. The default is 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 |
| Sets the JPEG quality to use when compressing images in DCT format. The default is 3 - medium quality. |
setRenameFonts |
| 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 |
| Can only be set with When set to true, will remove all Unicode strings from the emitted XPS. Instead, explicit glyph IDs will be used. |