Created Date: 27 Nov, 2020 09:43
Last Modifed Date: 01 Aug, 2022 10:40


The following settings are supported:

Parameter

Possible values

Description

PDFVersion

1.3

1.4

1.5

1.6

1.7

2.0

Sets PDF version. The default is 1.7.

PDF/A-1b

PDF/A-2b

PDF/A-3b

PDF/A-2u

PDF/X-1a

PDF/X-4

For PDF/A, consider using a PDF/A preset.

The conformance level PDF/A-2u (“u“ = “Unicode“) simplifies text searching and copying by ensuring text has a Unicode representation.

For PDF/X-1a, consider using a PDF/X-1a preset.

For PDF/X-4, consider also setting an output intent with the TargetProfile parameter, or use the PDF/X-4 Preset.

RenderResolution

1 to 32768

Sets the resolution of page portions that must be rendered (for example, to flatten transparency). The default is 300dpi.

RenderedImageCompression

Auto

Flate

DCT

LZW

RLE

Set the desired image compression for images that are the result of rendering. The default is eICFlate. If set to auto, flate is used.

This is advisory only and may not be honored in all cases. For example, PDF/A does not allow LZW.

MonoImageDownsamplingResolution0 to 32768The desired output resolution, in dpi. Pass 0 to leave images unchanged, which is the default.
MonoImageDownsamplingThreshold0 to 32768

The threshold above which images are reduced to the desired resolution. Pass 0 to use the resolution.

MonoImageDownsamplingMethod

Subsample

Average

Bicubic

The method to use when downsampling. The default is subsample for monochrome images; using any other method results in grayscale output.

GrayImageDownsamplingResolution0 to 32768The desired output resolution, in dpi. Pass 0 to leave images unchanged, which is the default.
GrayImageDownsamplingThreshold0 to 32768

The threshold above which images are reduced to the desired resolution. Pass 0 to use the resolution.

GrayImageDownsamplingMethod

Subsample

Average

Bicubic

The method to use when downsampling. The default is bicubic for gray images.
ColorImageDownsamplingResolution0 to 32768The desired output resolution, in dpi. Pass 0 to leave images unchanged, which is the default.
ColorImageDownsamplingThreshold0 to 32768

The threshold above which images are reduced to the desired resolution. Pass 0 to use the resolution.

ColorImageDownsamplingMethod

Subsample

Average

Bicubic

The method to use when downsampling. The default is bicubic for color and grayscale images.

ColorImageCompression

Auto

Flate

DCT

LZW

RLE

Set the desired image compression for color images that need to be re-encoded. The default is eICAuto.

CCITT is not allowed for color images.

This is advisory only and may not be honored in all cases.

GrayImageCompression

Auto

Flate

DCT

LZW

RLE

Set the desired image compression for gray images that need to be re-encoded. The default is Auto.

CCITT is not allowed for gray images.

This is advisory only and may not be honored in all cases. For example, PDF/A does not allow LZW.

MonoImageCompression

Auto

CCITT

Flate

Set the desired image compression for monochrome images that need to be re-encoded. The default is CCITT.

JPEG/DCT is not allowed for mono images, and auto is set to CCITT.

This is advisory only and may not be honored in all cases. For example, PDF/A does not allow LZW.

UseMaskResolutionForMaskedImages

true

false

If true, the target resolution and threshold applied to the mask are also applied to the image.

If false, then the mask and the image are evaluated separately and a downsampling resolution and threshold are chosen. This mode enables the image and mask to be downsampled to different resolutions.

The default is true.

Has no effect if downsampling is not enabled.

DownsampleMaskedImages

true

false

Sets whether to downsample masked images. The default is true.

This setting is ignored if downsampling is not enabled.

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

JPEGChromaSubsampling

true

false

Chroma subsampling is desirable for natural images, as it can result in lower file sizes without significantly lowering perceived quality. However, for artificial images such as rasterized text sharp transitions from one color to another are present, the result can be unwanted artifacts that compromise the perceived quality of image.

This setting is used in conjunction with JPEGQuality. The default value is true (on) for a JPEGQuality of 1, 2, or 3 and false (off) for a JPEGQuality of 4 or 5. This setting allows the default to be overridden, for example by setting:

JPEGQuality=3, JPEGChromaSubsampling=false

The combination of these two settings keeps the output file size low without compromising the quality of artificial images. They should be set in the order shown (that is, JPEGQuality first).

TargetColorSpace

DeviceRGB

DeviceGray

DeviceCMYK

By default, the target color space is used if anything must be rendered or color-converted. The default behavior is to apply this only when required. Use ConvertAllColors if converting everything is required.

For PDF/A-1b output, an OutputIntents dictionary is created for this color space. LAB color spaces may not be used as a destination color space for PDF/A.

For PDF/X-1a output, only DeviceCMYK is supported; this setting is ignored.

TargetProfile

Path to ICC profile

Sets the target color space for the output using an ICC profile.

By default, the target color space is used if anything must be rendered or color-converted. The default behavior is to apply this only when required. Use ConvertAllColors if converting everything is required.

When used in conjunction with "Preset=PDF/X-4" the OutputIntent of the target PDF is set to this profile.

ConvertAllColors

true

false

Sets whether all content should be color-converted to the target space set by TargetProfile.

The default is false.

This parameter is ignored and assumed true when writing to PDF/A-1b or PDF/X-1a format output.

ConvertGray

true

false

Set whether gray colors should be subject to color conversion (that is, colors using DeviceGray, sGray, or single-component ICC color spaces).

The default is true.

This parameter is ignored unless ConvertAllColors = true.

OverrideMaximumICCVersionMajorinteger

Override the maximum allowed ICC profile version for PDF output

Different PDF versions allow different ICC profile versions to be embedded. PDF/X-4 for example, by a strict reading of the specification, allows ICC profiles of version 4.2 or earlier. However, some consumers allow newer ICC Profiles to be used. This API allows the maximum ICC version to be overridden. Only do this if it is certain that the downstream consumers are able to handle the setting.

The default value is 0,0 indicating that the maximum version for the current PDF output version is used.

OverrideMaximumICCVersionMinorinteger
CompressPages

true

false

Set whether compression should be applied to page content. The default is true.

If you use incremental output, the content of unedited pages is not affected.

Creating an uncompressed PDF is not significantly larger, but it can be viewed or edited in a text editor, which is useful for debugging purposes.

EmbedBase14Fonts

true

false

Set whether the base 14 PDF fonts should be forcibly embedded. If true, this overrides the embedding settings in IDOMFontOpenType. Only the standard 14 fonts are not affected by this; use setEmbedFonts() to affect other fonts.

If you use incremental output, the content of unedited pages is not affected.

The default is false. This setting is ignored for PDF/A and PDF/X where it is forced to true.

EmbedFonts

true

false

Set whether fonts should be forcibly embedded. If true, this overrides the embedding settings in each IDOMFontOpenType. The standard 14 fonts are not affected by this; use setEmbedBaseFonts() instead.

If you use incremental output, the content of unedited pages is not affected.

The default is false. This setting is ignored for PDF/A and PDF/X where it is forced to true.

SubsetFonts

true

false

Set whether embedded fonts should be subset or not. The default is true.

This is a preference only. Some font types may require subsetting based on context.

If you use incremental output, the content of unedited pages is not affected.

AlwaysEmbedfontlist

Provide a list of name of fonts that should always be embedded, regardless of the settings for setEmbedFonts() or setEmbedBase14Fonts(). This setting is ignored for PDF/A.

If you use incremental output, the content of unedited pages is not affected.

The fontlist is a string with the fonts delimited with semicolons (backslashes are used as an escape character).

NeverEmbedfontlist

Provide a list of name of fonts that should never be embedded, regardless of the settings for setEmbedFonts() or setEmbedBase14Fonts(). This setting is ignored for PDF/A.

If you use incremental output, the content of unedited pages is not affected.

The fontlist is a string with the fonts delimited with semicolons (backslashes are used as an escape character).

AllowRestrictedFonts

true

false

Allow restricted fonts to be embedded in the output.

If true, fonts that flag that they should not be embedded are allowed to be embedded. If false, then such fonts are not embedded. Set this to true if you have sufficient permissions to do so.

For PDF/X-4 and PDF/A-2b output, the output instead fails if this setting is false and a restricted font is encountered.

The default is false.

EnableTrueTypeNotDef

true

false

Enable the use of a True Type font's /.notdef glyph in the output.

If true, a character that does not have a glyph or that has been linked to the /.notdef glyph is replaced by the /.notdef glyph.

If false, a character that does not have a glyph or that has been linked to the /.notdef glyph is ignored.

For PDF/X-4 and PDF/A-2b output, the flag is set to true anyway. This flag is also ignored if BlockNotdefGlyphs() is set to true.

The default is true.

BlockNotdefGlyphs

true

false

Set whether to block notdef glyphs from PDF output.

If true, notdef glyphs that are not-marking are dropped, and if a marking notdef character is encountered, an error is thrown. Also if true, the setting EnableTrueTypeNotDef() is ignored.

This setting is ignored for PDF/A and PDF/X.

The default is false.

Emit30CmapSubtableForSymbolicTrueTypeFonts

true

false

Set whether to add a 3,0 ("Windows") "cmap" subtable to symbolic TrueType fonts in PDF output.

If true, a 3,0 cmap subtable is emitted alongside a 1,0 format subtable for symbolic TrueType fonts. If false, only the 1,0 subtable is emitted.

This setting is ignored for PDF/A and PDF/X.

The default is true.

Such subtables are required for compatibility with some PDF consumers, and are well tolerated by most PDF consumers. However, some preflight tools may emit errors. This can be set false to afford compatibility with such tools. If you're unsure, please contact Mako support.

Linearize

true

false

The default is false. When true, a PDF optimized for byte serving (for example from a web server) is produced. This is generally a slow operation.

AutoRotatePages

true

false

Set whether pages should be automatically rotated. The default is false.

If you use incremental output, the content of unedited pages is not affected.

If true, pages are automatically rotated based on the prevalent text direction on the page. If you use incremental output, non-modified pages are not subject to this setting.

The rotation is not a physical rotation of content, merely the PDF Page's view rotate is set appropriately.

ProducerstringSets the producer string, overriding the default value that is set to Mako Vx.x.x, where x.x.x is the version number.
ForceEmitPageGroup

true

false

If an input PDF page contains a transparency page group, Mako does not emit a page group in an output PDF unless it detects that the page actually contains transparency. This default behavior is overridden by setting this to true. The default is false. As true is a safe setting in all circumstances, future versions of Mako may make this the default behavior.

ForceMediaBoxOriginZero

true

false

In Mako 5.2.1, a change was made such that the MediaBox was retained as-is when writing non-incremental pages to PDF. Prior to this change, incremental pages always retained their (possibly non-zero) origin, whereas non-incremental pages would have their MediaBox origin reset to 0,0. Setting this parameter to true (default is false) forces the page MediaBox box origin to 0,0. Annotations and Crop/Art/Trim/etc. boxes are written using values relative to the top left, so this setting also affects those.

AllowOptionalContentUpdateDuringWrite

true

false

Allows Optional Content to be updated while an IOutputWriter is in progress.

For this to work, groups being used on a given page must have been added to the optional content before writing that page. The default is false.


  • Deleting groups is not advisable.
  • Editing groups does not reliably result in the edits being honored; it is undefined behavior and should be avoided.

The downsampling options described here don't always produce the expected result. See Downsampling of masked images for further details.