Skip to main content
Skip table of contents

CLI parameters (makodistiller)

Sample

makodistiller is a simple command-line sample, similar to makoconverter, that exercises the IDistiller class.

This sample is located in the makoapps folder of the Mako distribution and can be built for Windows, Linux, or macOS.

If you run it without arguments, a usage string is displayed:

TEXT
Usage: makodistiller.exe <source file> <output file> [ parameter=value parameter=value ... ]

The source file is PostScript and the output a PDF, the conversion controlled by parameters that can be added to the command line.

makodistiller allows you to experiment with these parameters, for example:

TEXT
makodistiller MyInput.ps MyOutput.pdf EmbedFonts=true

You can set the following parameters:

IDistiller::setParameter

The IDistiller class offers a method to set the PDF creation parameters in code, using setParameter() with two strings.

TEXT
IDistillerPtr output = IDistiller::create(jawsMako);
output->setParameter("ColorImageCompression", "DCT");

This method supports scenarios where it is necessary to set an output parameter at runtime (for example, in a printer driver where you are offered options from a menu).

Parameters

The following settings are supported:

Parameter

Possible values

Description

PDFVersion

1.3

1.4

1.5

1.6

1.7

Sets PDF version. The default is 1.3.

PageFilterLow

<integer>

Sets the lower limit of pages to be included in the output.

Pages are numbered starting with page 1.  If set to 0, no lower page limit is set.

PageFilterHigh

<integer>

Sets the upper limit of pages to be included in the output.

Pages are numbered starting with page 1.  If set to a non-zero value, all input data following that page is silently discarded.

If set to 0, no upper page limit is set.

Title

<text>

Sets the content of the Title field of the PDF's Document Properties.

Author

<text>

Sets the content of the Author field of the PDF's Document Properties.

Subject

<text>

Sets the content of the Subject field of the PDF's Document Properties.

Creator

<text>

Sets the content of the Creator field in the PDF's Document Properties. (This information is labeled Application in Adobe Acrobat.)

AutoRotatePages

true

false

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

If true, pages rotate automatically based on the prevalent text direction on the page.

TrimToBBox

true

false

Set whether to use the BoundingBox DSC comment to set the PDF page size. Content positioned outside this area is discarded.

The default is false.

CropToBBox

true

false

Set whether to use the BoundingBox DSC comment for the PDF CropBox. The default is false.

Content positioned outside this area is retained but is not visible, as a PDF's CropBox determines the viewable area of the page.

HiResBBox

true

false

Set whether to use the HiResBoundingBox DSC comment, if present.

When set to true, and TrimToBBox or CropToBBox are set to true, the HiResBoundingBox DSC comment is used for the page size (or CropBox) instead of the BoundingBox DSC comment.

If set to true and the job defines no HiResBoundingBox DSC comment, the BoundingBox is used.

The default is false.

CompressPages

true

false

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

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

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

CompressObjects

true

false

Sets whether PDF objects should be compressed. Applies to PDF 1.5 and later. The default is false.

SubsetFonts

true

false

Sets 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.

EmbedFonts

true

false

Sets whether fonts should be forcibly embedded. If true, this overrides individual font embedding settings.

The standard 14 fonts are not affected by this. The default is false.

EmbedBase14Fonts

true

false

Set whether the base 14 PDF fonts should be forcibly embedded. The default is false.

Only the standard 14 fonts are not affected by this; use EmbedFonts to affect other fonts.

EmbedDiskBasedCidFonts

true

false

Set whether CID fonts obtained from resources (that is, disk-based CID fonts) can be embedded.

This setting is only effective if the EmbedFonts parameter is set to true.

Resolution

0 to 32768

The desired output resolution, in dpi. Pass 0 to leave images unchanged. The default is 288 dpi.

Transfers

Apply

Remove

Preserve

Sets the desired method to for controlling transfer functions. The default is Remove.

Apply: The effect of a transfer function is applied to the page content before being stored in the PDF file.

Remove: Transfer functions are ignored.

Preserve: Transfer functions are stored in the PDF file.

ColorImageCompression

None

Auto

Flate

FlatePredict

DCT

LZW

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

CCITT is not allowed for color images.

DCT (Discrete Cosine Transform) refers to JPEG compression.

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

GrayImageCompression

None

Auto

Flate

FlatePredict

DCT

LZW

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

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

None

Auto

CCITT

Flate

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

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.

ColorJPEGQuality

Low

Medium

High

User

Sets the JPEG quality to use when compressing color images in DCT format. The default is Low.

ColorQFactor

0-1,000,000

Set the QFactor to use when compressing color images in DCT format.

Applies only when setting the ColorJPEGQuality to User.

The valid range of this field is from 0 to 1,000,000. Large numbers give better compression; small numbers give better quality.

GrayJPEGQuality

Low

Medium

High

User

Sets the JPEG quality to use when compressing gray images in DCT format. The default is Low.

GrayQFactor

0-1,000,000

Set the QFactor to use when compressing gray images in DCT format.

Applies only when setting the GrayJPEGQuality to User.

The valid range of this field is from 0 to 1,000,000. Large numbers give better compression; small numbers give better quality.

ColorImageDownsampling

None

Subsample

Average

Bicubic

Set the desired downsampling method for color, grayscale, or monochrome images.

The default method is None (no downsampling).

GrayImageDownsampling

MonoImageDownsampling

ColorImageResolution

0 to 32768


Set the desired resolution when downsampling color, grayscale, or monochrome images.

The default is 72 dpi (dots-per-inch). A value of 0 leaves images unchanged.

GrayImageResolution

MonoImageResolution

ConvertCMYKImagesToRGB

true

false

Set whether to convert CMYK images to RGB.

The default is false.

PrologFile

<path to PostScript prolog>

Set a prolog stream to be consumed by the PostScript interpreter after the input stream is processed, or NULL to clear.

This stream is both opened and closed, and is not cloned; take care when opening multiple PostScript inputs with the same prolog simultaneously.

PrologCommand

PostScript data

Set a prolog to be consumed by the PostScript interpreter after the input stream is processed, in the form of a plaintext string.

EpilogFile

<path to PostScript prolog>

Set an epilog stream to be consumed by the PostScript interpreter after the input stream is processed, or NULL to clear.

This stream is both opened and closed, and is not cloned; take care when opening multiple PostScript inputs with the same epilog simultaneously.

EpilogCommand

PostScript data

Set an epilog to be consumed by the PostScript interpreter after the input stream is processed, in the form of a plaintext string.

DefaultPanoseStyle

<12-byte hex string>

Sets the default Panose style to be used when emitting a CID font that is not in the Panose list, or NULL to clear.

The Panose style must be a 12-byte hexadecimal string as described in the PDF reference (for example, 010502020300000000000000).

Panose

<path to list of Panose styles>

Sets a stream that refers to a list of CID font names and their associated Panose styles.

Each line of the list must consist of two fields that are tab delimited.
The first field is the font name. The second field is the complete string representing the Panose Style entry. For example:

GothicBBBPr6-Medium<tab>0801020b0500000000000000
GothicBBB-Medium<tab>0801020b0500000000000000

If set, the default Panose style is used when Jaws emits a CID font that is not in the list.

AddFont

<path to font resource>

Adds a font to the list of fonts for use when distilling with in-memory devices. Both the PostScript font name and the full name is added to the list.

When using font or resource devices on disk, addFont() adds the font to the list of fonts on disk. Any existing font with the same name is removed.

Only TrueType, TrueType collections, or OpenType/CFF fonts are supported.

FontDevice

<font device path>

Provides a method of using a custom PostScript font device in place of the usual in-memory device used by IDistiller.

You must provide a fully qualified directory path, and the directory must already exist; IDistiller does not create it automatically.

The font path must contain all the fonts required for distilling, and you may add more fonts when using AddFont.

ResourceDevice

<resource device path>

Provides a method of using a custom PostScript resource device in place of the usual in-memory device used by IDistiller.

You must provide a fully qualified directory path, and the directory must already exist; IDistiller does not create it automatically. The resource path must contain all the PostScript required for distilling, and you may add more fonts when using AddFont.

Overprint

true

false

Set whether overprinting should be preserved.

The default is false.

OverprintMode

true

false

Set the overprint mode.

The default is true, which sets non-zero overprint mode (/OPM 1).

When set to false, /OPM 0 is used when overprinting. 

Halftone

true

false

Set whether halftone information should be preserved.

The default is false.

OPI

true

false

Set whether OPI comments should be preserved.

The default is false.

ASCII85Encode

true

false

Set whether to ASCII85-encode streams.

The default is false.

Linearize

true

false

Set whether the output should be linearized. The default is false.

When true, a PDF optimized for byte serving (for example from a web server) is produced.

Choosing this option may slow down conversion.

JobTicket

true

false

Set whether to add a job ticket object to the output. The default is false.

When true, Portable Job Ticket information is added to the generated PDF file.

Thumbnails

None

Color

Mono

Set the PDF thumbnail type.

UseDeviceDependentColor

true

false

Set whether to convert device independent colors to device dependent colors.

The default is false.

PDF encryption

You can apply password-based security with these parameters. Please note:

  • Setting both a zero-length user and owner password disables encryption.

  • If encryption is enabled, the encryption algorithm is chosen based on the output PDF version.

  • If only a user password is supplied, it is also used for the owner password.

  • Permissions are only applied if encryption is enabled by supplying a password.

Parameter

Possible values

Description

OwnerPassword

<text>

A password that is used to protect the security settings.

UserPassword

<text>

A password that is used to encrypt the PDF content. This password is prompted for when the PDF is opened in a viewer.

Permissions

<bitmask>

A decimal integer determined from the table below. For example, to allow high-res printing and content extraction for accessibility, a value of 2,564 is required (4 + 512 + 2048).

Description

Hex

Decimal

Allow printing (bit 3)

0x0004

4

Allow editing (bit 4)

0x0008

8

Allow copying (bit 5)

0x0010

16

Allow annotation editing (bit 6)

0x0020

32

Allow form filling (bit 9)

0x0100

256

Allow content extraction in support of accessibility (bit 10)

0x0200

512

Allow document assembly (bit 11)

0x0400

1,024

Allow high-resolution printing (bit 12)

0x0800

2,048

All operations permitted

0x0FFC

4,092

JavaScript errors detected

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

If this problem persists, please contact our support.