Created Date: Nov 27, 2020 09:42
Last Modifed Date: Jan 12, 2021 16:11


Parameters

Mako supports methods to control the way in which an output file is produced. These can be set in code in two ways. For example, to set the version of PDF that will be written, the code is:

IPDFOutputPtr output = IPDFOutput::create(jawsMako);
output->setVersion(IPDFOutput::ePDF1_4);
CPP
IPDFOutput output = IPDFOutput.create(jawsMako);
output.setVersion(IPDFOutput.ePDF1_4);
C#

Or the same parameter can be expressed as two strings:

IPDFOutputPtr output = IPDFOutput::create(jawsMako);
output->setParameter("PDFVersion", "1.4");
CPP
IPDFOutput output = IPDFOutput.create(jawsMako);
output.setParameter("PDFVersion", "1.4");
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 sample makoconverter (included in the SDK) allows you to experiment with these parameters by adding them to a command line (for example):

makoconverter MyInput.pdf MyOutput.pdf pdfversion=1.4 TargetColorSpace=DeviceGray ConvertAllColors=true
makoconverter MyInput.pdf MyOutput.pdf preset=PDF/X-4
POWERSHELL

A preset sets a number of parameters in one go. See Presets below.

The various output classes that Mako supports offer their own set of output parameters, described on the pages in this section.

Presets

Presets "roll up" several parameters to be set together. They are a useful shortcut, particularly for PDF standards such as PDF/X or PDF/A, as they guarantee a compliant file, content permitting. They work in a similar way to parameters - see Output presets (PDF) for details.