FOM Reference > Application > fTemplate interface
  
fTemplate interface
This object represents the main template file once it has been loaded into PTC ALD, and can be accessed using the global property "template".
DebugFlags enumeration
Possible flag values for the debugFlag option in fTemplate.
The DebugFlags enumeration has the following constants of type int.
DEBUGFLAG_STATUS = 1
Switch on status messages for debugging.
DEBUGFLAG_STYLESHEET = 2
Switch on stylesheet messages for debugging.
DEBUGFLAG_CONTEXT = 4
Switch on messages when entering contexts.
DEBUGFLAG_JSTRACE_SETTERS = 8
Switch on Javascript trace messages for setters.
DEBUGFLAG_JSTRACE_GETTERS = 16
Switch on Javascript trace messages for getters.
DEBUGFLAG_JSTRACE_METHODS = 32
Switch on Javascript trace messages for methods.
DEBUGFLAG_JSTRACE_INIT_CREATE_DESTROY = 64
Switch on Javascript trace messages for initialising, creating and destroying.
DEBUGFLAG_JSTRACE_ENUMERATE = 128
Switch on Javascript trace messages for enumerations.
DEBUGFLAG_TAGTRACE = 256
Switch on tag trace messages for debugging.
DEBUGFLAG_LAYERGROUP = 512
Switch on messages when applying layergroups.
DEBUGFLAG_REPORT = 4096
Switch on reports for debugging.
DEBUGFLAG_PAGE = 8192
Switch on timing for formatting and garbage collection for each page.
DEBUGFLAG_XPATH = 32768
Switch on reports for XPath debugging.
bleedAreaBottom attribute
Macro: tdpref
The total amount of bleed area to reserve at the bottom of the printed page.
bleedAreaBottom
Access
read-write
Returns
fLength
bleedAreaLeft attribute
Macro: tdpref
The total amount of bleed area to reserve at the left of the printed page.
bleedAreaLeft
Access
read-write
Returns
fLength
bleedAreaRight attribute
Macro: tdpref
The total amount of bleed area to reserve at the right of the printed page.
bleedAreaRight
Access
read-write
Returns
fLength
bleedAreaTop attribute
Macro: tdpref
The total amount of bleed area to reserve at the top of the printed page.
bleedAreaTop
Access
read-write
Returns
fLength
bleedSize attribute
Macro: tdpref
The amount of space frames are allowed to bleed over the main page when printing.
bleedSize
Access
read-write
Returns
fLength
bleedString attribute
Macro: tdpref
The string to output in between the cutting guides when printing.
bleedString
Access
read-write
Returns
String
content attribute
The object that provides access to the contents of this template, such as tags, pages, control streams, etc.
content
Access
read-only
Returns
fContent
cuttingGuideOffset attribute
Macro: tdpref
The distance away from the page to draw the cutting guides.
cuttingGuideOffset
Access
read-write
Returns
fLength
cuttingGuideSize attribute
Macro: tdpref
The length of the cutting guides to use when printing.
cuttingGuideSize
Access
read-write
Returns
fLength
debugFlag attribute
Flag for outputting timestamped debug and profiling information during formatting. Output will be directed to the LOG_JSDBG log. Values for this property can be found in the fTemplate.debugFlags constants.
debugFlag
Access
read-write
Returns
int
documentSequence attribute
Macro: tdpref
This document sequence will be used to control the layout of the document the need to create any initial pages or setting up autocopy.
documentSequence
Access
read-write
Returns
fDocumentSequence
errorLogClasses attribute
A flag representing the default type of formatting errors to log. Value should be one of fFormat.ErrorLogClassFlags.
errorLogClasses
Access
read-write
Returns
int
errorLogErrors attribute
If true, any errors raised during formatting will be written to the formatting error log by default.
errorLogErrors
Access
read-write
Returns
boolean
errorLogOutput attribute
The default location to write all error log messages during formatting.
errorLogOutput
Access
read-write
Returns
String
errorLogOverrides attribute
Override the default severity levels of individual error messages. The property of the array is an underscore followed by the log message number (e.g. "_1101"), the value is one of fFormat.ErrorLogSeverityOverride to represent the severity the warning should be.
errorLogOverrides
Access
read-only
Returns
fStringArray
errorLogSeverity attribute
A flag representing the default level of severity of formatting errors to log. Value should be one of fFormat.ErrorLogSeverityFlags.
errorLogSeverity
Access
read-write
Returns
int
generatePageChecksums attribute
If true, page checksums will be calculated when formatting this document.
generatePageChecksums
Access
read-write
Returns
boolean
isActive attribute
If true, this template is the current active template in PTC ALD.
isActive
Access
read-only
Returns
boolean
isPassStable attribute
true when the last format pass correctly evaluated all data that was tracked as unstable. Stability tracking is triggered by calls to formatUnstableStream and evaluateUnstableXPath.
isPassStable
Access
read-only
Returns
boolean
isReadOnly attribute
If true, this template is readonly and cannot be modified.
isReadOnly
Access
read-only
Returns
boolean
name attribute
The name of the template file.
name
Access
read-only
Returns
String
pasteboard attribute
Macro: tpboard
The layout to use for the pasteboard. If this property is null, then no pasteboard will be displayed.
pasteboard
Access
read-write
Returns
fLayer
pasteboardSide attribute
Macro: tpboard
If true, the pasteboard will be positioned to the right of the main page. Otherwise, it will be displayed underneath the main page.
pasteboardSide
Access
read-write
Returns
boolean
path attribute
The location of the template file.
path
Access
read-only
Returns
fPath
preFormatStream attribute
Macro: tdpref
Before the document is formatted, this stream will be processed to allow the template to set up any content or structures it may need.
preFormatStream
Access
read-write
Returns
fStream
preferences attribute
Macro: tdpref, tdspref
The preferences for this template.
preferences
Access
read-only
Returns
fTemplatePreferences
properties attribute
Macro: tdprop
The document properties for this template, such as title, author and subject.
properties
Access
read-only
Returns
fDocumentProperty
serializer attribute
Provides access to the instance of Serializer used when saving objects in JavaScript Object (.Jo) streams, see template.content.storedObjects[].
serializer
Access
read-only
Returns
Object
close method
Macro: wcl
Closes the current template.
closesave
Parameters
booleansave
If true, the document will be saved before closing, otherwise any recent changes will be abandoned.
Returns
void. None.
format method
Macro: tformat
Formats the whole document.
formatformat
Parameters
fFormatformat
The settings to use to control formatting. If not provided, the entire document will be formatted with no special processing such as index or anchor controls.
Returns
void. None.
pageLabelLocate method
This method will locate all the page numbers that the specified label was stored on the previous formatting pass. If this is the first formatting pass, then no values are returned.
pageLabelLocatelabelneedString
Parameters
Stringlabel
The page label to locate on the previous formatting pass.
booleanneedString
If true, the returned array will contain the contents of fPage.pageString for the pages instead of the absolute page numbers.
Returns
int[]. An array of all the absolute page numbers that the specified page label was found.
print method
Macro: tprint
Prints the document using the printer and settings provided.
printprinter
Parameters
fPrintprinter
The settings to use to control printing.
Returns
void. None.
publish method
Publishes the document, formatting and printing it at the same time.
publishpublish
Parameters
fPublishpublish
The settings to use during formatting and printing.
Returns
void. None.
readonly method
Changes the read only status of the document.
readonlyreadonly
Parameters
booleanreadonly
If true, makes the template read only, preventing further changes. If false, makes it read write, allowing further changes to be made.
Returns
void. None.
revert method
Macro: trevert
Closes the template without saving and reverts to the last saved version.
revertforce
Parameters
booleanforce
If true, the template will be reverted regardless of any changes made, otherwise an exception will be thrown.
Returns
void. None.
save method
Macro: tsave, tsaven
Saves the template.
savefilenameforcecopyLinks
Parameters
fPathfilename
The filename to save the template as. If this parameter is not provided, the existing template path will be used.
booleanforce
If true, any existing file with the same name will be overwritten, otherwise an exception will be thrown.
booleancopyLinks
If true, any files linked to tags will be copied into a directory relative to the template and the link paths will be updated to point to them.
Returns
void. None.