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:
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:
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.
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 |
| Sets PDF version. The default is |
PageFilterLow | <integer> | Sets the lower limit of pages to be included in the output. Pages are numbered starting with page |
PageFilterHigh | <integer> | Sets the upper limit of pages to be included in the output. Pages are numbered starting with page If set to |
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 |
| Set whether pages should be automatically rotated. The default is If |
TrimToBBox |
| Set whether to use the The default is |
CropToBBox |
| Set whether to use the Content positioned outside this area is retained but is not visible, as a PDF's |
HiResBBox |
| Set whether to use the When set to If set to The default is |
CompressPages |
| Sets whether compression should be applied to page content. The default is 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 |
| Sets whether PDF objects should be compressed. Applies to PDF 1.5 and later. The default is |
SubsetFonts |
| Sets whether embedded fonts should be subset or not. The default is This is a preference only. Some font types may require subsetting based on context. |
EmbedFonts |
| Sets whether fonts should be forcibly embedded. If The standard 14 fonts are not affected by this. The default is |
EmbedBase14Fonts |
| Set whether the base 14 PDF fonts should be forcibly embedded. The default is Only the standard 14 fonts are not affected by this; use EmbedFonts to affect other fonts. |
EmbedDiskBasedCidFonts |
| 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 |
Resolution |
| The desired output resolution, in dpi. Pass |
Transfers |
| Sets the desired method to for controlling transfer functions. The default is
|
ColorImageCompression |
| Set the desired image compression for color images that need to be re-encoded. The default is 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 |
| Set the desired image compression for gray images that need to be re-encoded. The default is 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 |
| Set the desired image compression for monochrome images that need to be re-encoded. The default is JPEG (DCT) is not allowed for mono images, and This is advisory only and may not be honored in all cases. |
ColorJPEGQuality |
| Sets the JPEG quality to use when compressing color images in DCT format. The default is |
ColorQFactor |
| Set the Applies only when setting the The valid range of this field is from |
GrayJPEGQuality |
| Sets the JPEG quality to use when compressing gray images in DCT format. The default is |
GrayQFactor |
| Set the Applies only when setting the The valid range of this field is from |
ColorImageDownsampling |
| Set the desired downsampling method for color, grayscale, or monochrome images. The default method is |
GrayImageDownsampling | ||
MonoImageDownsampling | ||
ColorImageResolution |
| Set the desired resolution when downsampling color, grayscale, or monochrome images. The default is |
GrayImageResolution | ||
MonoImageResolution | ||
ConvertCMYKImagesToRGB |
| Set whether to convert CMYK images to RGB. The default is |
PrologFile | <path to PostScript prolog> | Set a prolog stream to be consumed by the PostScript interpreter after the input stream is processed, or 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 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 The Panose style must be a 12-byte hexadecimal string as described in the PDF reference (for example, |
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.
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, 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 You must provide a fully qualified directory path, and the directory must already exist; The font path must contain all the fonts required for distilling, and you may add more fonts when using |
ResourceDevice | <resource device path> | Provides a method of using a custom PostScript resource device in place of the usual in-memory device used by You must provide a fully qualified directory path, and the directory must already exist; |
Overprint |
| Set whether overprinting should be preserved. The default is |
OverprintMode |
| Set the overprint mode. The default is When set to |
Halftone |
| Set whether halftone information should be preserved. The default is |
OPI |
| Set whether OPI comments should be preserved. The default is |
ASCII85Encode |
| Set whether to ASCII85-encode streams. The default is |
Linearize |
| Set whether the output should be linearized. The default is When Choosing this option may slow down conversion. |
JobTicket |
| Set whether to add a job ticket object to the output. The default is When |
Thumbnails |
| Set the PDF thumbnail type. |
UseDeviceDependentColor |
| Set whether to convert device independent colors to device dependent colors. The default is |
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).
|