Set Transform Property

Scripting call:
SetTransformProperty (sType, sName, sValue)

Function

Set the value of a property used during a transformation. This affects the result of the Transform XML, Get PDF, GetTransform and Convert XML to PDF methods, depending on the transformation type specified.

Consult the User Guide for a list of secondary transform properties.

Arguments

sType

A string identifying the type of transformation required. Specifying pdf as the transformation type affects PDF creation

sName

The name of the property to set.

sValue

The value of the property.

PDF Property Descriptions

The following table describes the properties used to control PDF generation.

Note that all names and values are in lower case, and are case sensitive. This method gives no indication or error if an illegal name and/or value is used. An error may or may not be raised when the transformation is executed.

Property Name Possible values Description
profile see below The name of the profile to use when creating the PDF. Note that you must set this value before any others, as described below.
fonts noembed or embedignore or embederror or embedabort Controls embedding of fonts. noembed (the default) disables embedding, while the other options determine what happens when embedding fails. embedignore produces no messages; embederror produces a message and continues; embedabort aborts the PDF creation. Note that embedding for specific fonts can be overridden by the font configuration.
bookmarks off or on Controls whether or not bookmarks are created in the PDF. Defaults to on.
links badignore or badwarn or badabort or off Controls the creation of hyperlinks in the PDF. off disables the creation of links, while the other options determine what happens when a bad link (one that has no endpoint) is encountered. badignore (the default) produces no messages; badwarn produces a message and continues; badabort aborts the PDF creation.
badlinks comment or off Determines whether bad links are annotated in the PDF. This is only relevant when the links property is set to create hyperlinks. Set this to comment to create a comment for each bad link showing its value.
security nocopy or noprint or nocopyprint or off Controls the security options of the PDF. off (the default) produces a PDF with no restrictions; nocopy prevents data from being copied; noprint prevents printing; nocopyprint prevents both.
linkparts string A string specifying one or more partitions which may contain endpoints of links in the generated PDF. For more information see the description of the sLinkParts argument to GetPDF.

Using a PDF Profile

You can set up a number of PDF profiles containing different options to use when creating a PDF. Each profile is identified by name; to select a profile, use its name as the property value. For example:

tl.SetTransformProperty("pdf", "profile", "print");

When a value is set for the profile property, all other properties for the same type are cleared. This means that if you want to use properties to override the options in the profile, you must select the profile first, and then set the overriding properties. For example:

tl.SetTransformProperty("pdf", "profile", "print");
/* All "pdf" properties have been cleared */
tl.SetTransformProperty("pdf", "bookmarks", "on");