FOM Reference > Content > fContent interface
  
fContent interface
This object contains all the source objects that make up the template, providing methods for finding and creating those objects.
GotoPagePosition enumeration
Options for selecting one of the pages adjacent to the current one.
The GotoPagePosition enumeration has the following constants of type int.
GOTO_NEXTPAGE = -2
Go to the next page.
GOTO_PREVIOUSPAGE = -1
Go to the previous page.
NamedColorTypes enumeration
Different types of named color objects.
The NamedColorTypes enumeration has the following constants of type int.
COLOR_ANY = -1
Any named color object. This value is not valid when used with fContent.createNamedColor().
COLOR_NAMED = 0
A named color.
COLOR_GRADIENT = 1
A gradient color.
COLOR_RASTER = 2
A raster color.
PageChecksumModes enumeration
The different page checksum reports to generate
The PageChecksumModes enumeration has the following constants of type int.
CHECKSUM_FULL = 0
Full report, one report line for each page. The value of baseReport will be ignored and should be left empty.
CHECKSUM_CHANGED = 1
Compare the checksums against the values in baseReport and output one report line for each page that has changed.
CHECKSUM_NEW = 2
Compare the checksums against the values in baseReport and output one report line for each new page that does not exist in the old report.
CHECKSUM_NEWCHANGED = 3
Compare the checksums against the values in baseReport and output one report line for each page that has either changed or does not exist in the old report.
CHECKSUM_UNCHANGED = 4
Compare the checksums against the values in baseReport and output one report line for each page that has the same checksum data as the old report.
NamespaceMergeModes enumeration
How to handle loading a namespace file if tags already exist in the template.
The NamespaceMergeModes enumeration has the following constants of type int.
MERGE_NONE = 0
If the namespace tag already exists, raise an error and stop loading the namespace.
MERGE_KEEP_EXISTING = 2
If a tag in the namespace already exists, keep the existing tag and discard the one in the namespace.
MERGE_KEEP_NAMESPACE = 3
If a tag in the namespace already exists, load the tag in the namespace and discard the existing one in the template.
PDFFormItemTypes enumeration
Different types of PDF Form items.
The PDFFormItemTypes enumeration has the following constants of type int.
PDFFORM_ANY = -1
Any PDF Form object. This value is not valid when used with fContent.createPDFFormItem().
PDFFORM_PUSHBUTTON = 0
A push button.
PDFFORM_CHECKBOX = 1
A checkbox.
PDFFORM_RADIOBUTTON = 2
A radio button.
PDFFORM_LISTBOX = 3
A listbox.
PDFFORM_COMBOBOX = 4
A combobox.
PDFFORM_TEXTFIELD = 5
A text field.
PDFFORM_SIGNATURE = 6
A signature.
accolades attribute
This is a read only array of all accolade objects stored in the template. Each item in the array is the control version of the tag.
accolades
Access
read-only
Returns
fAccolade[]
bookmarks attribute
This is a read only array of all bookmark objects stored in the template.
bookmarks
Access
read-only
Returns
fBookmark[]
colors attribute
This is a read only array of all named color objects stored in the template.
colors
Access
read-only
Returns
fArray
contexts attribute
This is a read only array of all context objects stored in the template. Each item in the array is the control version of the tag.
contexts
Access
read-only
Returns
fContexts[]
controls attribute
This is a read only array of all control objects stored in the template. This includes layers, frames, footnotes, indexes, etc.
controls
Access
read-only
Returns
fControl[]
events attribute
This contains events that can be triggered during formatting or printing.
events
Access
read-only
Returns
fPublishEvents
fonts attribute
This is a read only array of all font objects stored in the template.
fonts
Access
read-only
Returns
fArray
footnotes attribute
This is a read only array of all footnote objects stored in the template. Each item in the array is the control version of the tag.
footnotes
Access
read-only
Returns
fFootnote[]
frames attribute
This is a read only array of all frame control objects stored in the template. Each item in the array is the control version of the tag.
frames
Access
read-only
Returns
fFrame[]
functions attribute
This is a read only array of all function streams stored in the template.
functions
Access
read-only
Returns
fArray
graphics attribute
This is a read only array of all graphic objects stored in the template.
graphics
Access
read-only
Returns
fGraphic[]
indexes attribute
This is a read only array of all index objects stored in the template. Each item in the array is the control version of the tag.
indexes
Access
read-only
Returns
fIndex[]
layergroups attribute
This is a read only array of all layer group control objects stored in the template. Each item in the array is the control version of the tag.
layergroups
Access
read-only
Returns
fLayergroup[]
layers attribute
This is a read only array of all layer control objects stored in the template. Each item in the array is the control version of the tag.
layers
Access
read-only
Returns
fLayer[]
namespaces attribute
This is a read only array of all PTC ALD namespace objects stored in the template.
namespaces
Access
read-only
Returns
fNamespace[]
pages attribute
This is a read only array of all pages stored in the template.
pages
Access
read-only
Returns
fPage[]
pdfActions attribute
This is a read only array of all PDF Action objects stored in the template.
pdfActions
Access
read-only
Returns
fArray
pdfFormItems attribute
This is a read only array of all PDF Form objects stored in the template.
pdfFormItems
Access
read-only
Returns
fArray
pdfLayers attribute
This is a read only array of all PDF Layer objects stored in the template.
pdfLayers
Access
read-only
Returns
fArray
pdfMediaAssets attribute
This is a read only array of all PDF Media Assets objects stored in the template.
pdfMediaAssets
Access
read-only
Returns
fArray
pdfU3DViews attribute
This is a read only array of all PDF Form objects stored in the template.
pdfU3DViews
Access
read-only
Returns
fArray
publishes attribute
This is a read only array of all publish objects stored in the template. Each item in the array is the control version of the tag.
publishes
Access
read-only
Returns
fPublish[]
rasters attribute
This is a read only array of all raster objects stored in the template.
rasters
Access
read-only
Returns
fRaster[]
storedObjects attribute
An array containing JavaScript objects stored in the template.
Assigning to elements in this array stores the given object in the named tag (if it exists). Tags can only be created or deleted by the usual fContent methods.
Assigning null will instead assign an empty object.
storedObjects
Access
read-only
Returns
fArray
streams attribute
This is a read only array of all text stream objects stored in the template.
streams
Access
read-only
Returns
fStream[]
tags attribute
This is a read only array of all content objects stored in the template.
tags
Access
read-only
Returns
fTag[]
tagsByType attribute
This is a read only array of all tags stored in the template indexed by type, see fTag.TagType.
tagsByType
Access
read-only
Returns
fArray
copyTag method
Macro: ttagcopy
Copies the named tag to a new tag.
copyTagfromtofromnstons
Parameters
Stringfrom
The full name of the source tag to copy, including any PTC ALD namespaces.
Stringto
The name of the new tag to create.
fNamespacefromns
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
fNamespacetons
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fTag. Returns the new object, which will either be fStream, fGraphic, fRaster or fNamespace (depending on type).
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
createAccolade method
Creates an Accolade object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createAccoladenamens
Parameters
Stringname
The name of the Accolade object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fAccolade. Returns the newly created fAccolade object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createBarcode method
Creates an fGraphic tag containing a barcode generated from the specified data.
createBarcodenamewidthheightforegroundColorbackgroundColorbarcodevalue
Parameters
Stringname
The name of the graphic tag to create and generate the barcode into. The type of stream will be fTag.TYPE_GRAPHIC.
fLengthwidth
The width of the barcode.
fLengthheight
The height of the barcode.
fColorforegroundColor
The foreground color to use for the barcode.
fColorbackgroundColor
The background color to use for the barcode.
fBarcodebarcode
Either an fBarcode object containing the properties of the barcode, or an integer from fBarcode.BarcodeTypes specifying the type of barcode to create.
Stringvalue
The value to use when encoding the barcode. If multiple values are provided, a stacked barcode will br created, if allowed by the barcode type.
Returns
fGraphic. The graphic tag containing the generated barcode, if successful.
createBookmark method
Macro: ttagmk
Creates a bookmark of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createBookmarknamens
Parameters
Stringname
The name of the tag to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fBookmark. Returns the newly created fBookmark object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
INVALID_TYPE: A non text stream type was provided.
createContexts method
Creates a context set object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createContextsnamens
Parameters
Stringname
The name of the context set object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fContexts. Returns the newly created fContexts object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createControl method
Creates a control object of the given name and type, adding it to the template. If an invalid type is specified, or a tag of the same name already exists, a Content exception will be raised.
createControlnametypens
Parameters
Stringname
The name of the control object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
inttype
The type of object to create. This must be one of the control object types listed in fControl.ControlType.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fControl. Returns the newly created fControl object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
INVALID_TYPE: An invalid control object type was provided.
createDocumentSequence method
Creates a Document Sequence object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createDocumentSequencenamens
Parameters
Stringname
The name of the Document Sequence object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fDocumentSequence. Returns the newly created fDocumentSequence object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createFootnote method
Creates a Footnote object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createFootnotenamens
Parameters
Stringname
The name of the Footnote object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fFootnote. Returns the newly created fFootnote object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createFrame method
Creates a frame object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createFramenamens
Parameters
Stringname
The name of the frame object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fFrame. Returns the newly created fFrame object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createFunction method
Macro: ttagmk
Creates a JS Function tag of the given name and associates the specified function with it, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createFunctionnamefunctionns
Parameters
Stringname
The name of the tag to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
Objectfunction
A string containing JavaScript source code for the function to associate with the new tag, or a JavaScript Function object.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
Object. Returns the function object associated with the tag.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
INVALID_TYPE: A non text stream type was provided.
createIndex method
Creates a Index object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createIndexnamens
Parameters
Stringname
The name of the Index object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fIndex. Returns the newly created fIndex object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createLayer method
Creates a layer object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createLayernameunderlayns
Parameters
Stringname
The name of the layer object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
booleanunderlay
If true, the layer will be created as an underlay, otherwise it will be an overlay.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fLayer. Returns the newly created fLayer object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createLayerGroup method
Creates a layer group object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createLayerGroupnamens
Parameters
Stringname
The name of the layer group object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fLayerGroup. Returns the newly created fLayerGroup object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createNamedColor method
Creates a color object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createNamedColorcolortypens
Parameters
Stringcolor
The name of the color object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
inttype
The type of the color object to create. Value is one of fContent.NamedColorTypes or defaults to creating a named color.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fNamedColor. Returns the newly created fNamedColor, fGradientColor or fRasterColor object, depending on type.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createNamespace method
Macro: ttagmk
Creates an PTC ALD namespace, adding it to the template. If an invalid type is specified, or a tag of the same name already exists, a Content exception will be raised.
createNamespacenamens
Parameters
Stringname
The name of the PTC ALD namespace to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fNamespace. Returns the newly created fNamespace object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createPDFAction method
Creates a PDF Action object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createPDFActionlayerns
Parameters
Stringlayer
The name of the PDF Action object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fPDFAction. Returns the newly created fPDFAction object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createPDFFormItem method
Creates a PDF Form object of the given name and type, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createPDFFormItemnametypens
Parameters
Stringname
The name of the PDF Form object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace.
inttype
The type of PDF Form object to create. Value is one of fContent.PDFFormItemTypes to create a PDF Form item of that type.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fPDFFormItem. Returns the newly created fPDFFormItem object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createPDFLayer method
Creates a PDF Layer object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createPDFLayerlayerns
Parameters
Stringlayer
The name of the PDF Layer object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fPDFLayer. Returns the newly created fPDFLayer object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createPDFMediaAssets method
Creates a PDF Media Assets object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createPDFMediaAssetslayerns
Parameters
Stringlayer
The name of the PDF Media Assets object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fPDFMediaAssets. Returns the newly created fPDFMediaAssets object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createPDFU3DView method
Creates a PDF U3D View object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createPDFU3DViewlayerns
Parameters
Stringlayer
The name of the PDF U3D View object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fPDFU3DView. Returns the newly created fPDFU3DView object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createPageChecksumReport method
Creates a stream containing a report of the page checksums collected during the last format or print.
createPageChecksumReportreportmodebaseReportstartPageendPagelineElementpageNumberElementpageReformatElementformatElementprintElementpageShowString
Parameters
Stringreport
The name of the stream to write the report into. If this stream already exists, it will be overwritten.
intmode
Which type of report to create. Possible values are in fContent.PageChecksumModes.
fStreambaseReport
The stream containing the report to be used as a base for comparisons. If mode is set to fContent.CHECKSUM_FULL, this parameter will be ignored and should be left empty.
intstartPage
The first page to include in the report.
intendPage
The last page to include in the report.
StringlineElement
The name of the element to wrap each line in the report. This defaults to "ck_line".
StringpageNumberElement
The name of the element to wrap each page number in the report. This defaults to "ck_page".
StringpageReformatElement
The name of the element to wrap the page reformat checksum in the report. If this is empty, page reformat checksums are not included in the report. This defaults to "ck_trf".
StringformatElement
The name of the element to wrap the format checksum in the report. If this is empty, format checksums are not included in the report. This defaults to "ck_tformat".
StringprintElement
The name of the element to wrap the print checksum in the report. If this is empty, print checksums are not included in the report. This defaults to "ck_tprint".
StringpageShowString
The show string to use to format the page number This defaults to "$p".
Returns
fStream. The stream containing the checksum report.
createPageSequence method
Creates a Page Sequence object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createPageSequencenamens
Parameters
Stringname
The name of the Page Sequence object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fPageSequence. Returns the newly created fPageSequence object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createPublish method
Creates a publish object of the given name, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createPublishnamens
Parameters
Stringname
The name of the publish object to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fPublish. Returns the newly created fPublish object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
createStoredObject method
Create a new tag of type TYPE_JS_OBJECTS containing the given object.
createStoredObjectnameobjns
Parameters
Stringname
The name of the stored object tag to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
Objectobj
The object to store in the new tag.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fTag. The tag containing the given object.
createStream method
Macro: ttagmk
Creates a text stream of the given name and type, adding it to the template. If an invalid type is specified, or a tag of the same name already exists, a Content exception will be raised.
createStreamnametypens
Parameters
Stringname
The name of the tag to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
inttype
The type of stream to create. This must be one of the text stream types listed in fTag.TagType. This parameter defaults to fTag.TYPE_TEXT.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fStream. Returns the newly created fStream object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
INVALID_TYPE: A non text stream type was provided.
createTag method
Macro: ttagmk
Creates a tag of the given name and type, adding it to the template. If a tag of the same name already exists, a Content exception will be raised.
createTagnametypens
Parameters
Stringname
The name of the tag to create. If the name contains a colon, the tag will be created in the specified PTC ALD namespace. Otherwise, the name must follow standard PTC ALD naming conventions.
inttype
What type of tag to create. The list of possible tag types is available in fTag.TagType.
fNamespacens
The PTC ALD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fTag. Returns the newly created fStream, fGraphic, fRaster or fNamespace object (depending on type).
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
deletePage method
Macro: tpdel
Deletes the specified number of pages from the template, starting with the current page.
deletePagenum_pages
Parameters
intnum_pages
The number of pages to delete. If not provided, only 1 page will be deleted.
Returns
void. None.
deleteTag method
Macro: ttagdel
Deletes the named tag along with any content. Any existing pages or frames that use this tag will have the references removed. Other references in scripts or styles will ignored unless the updateText parameter is selected.
deleteTagnamensupdateTextreplaceText
Parameters
Stringname
The full name of the tag to delete, including any PTC ALD namespaces. This name can contain a wildcard to delete multiple tags.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
booleanupdateText
If true, a search and replace will automatically be performed, replacing any references to the name of this tag with the text in the replace parameter. Note that this action may not always be accurate, depending on the complexity of the template. This property defaults to false.
StringreplaceText
The text to use if updateText is true.
Returns
void. None.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
getAccolade method
Finds the named Accolade object, if it exists.
getAccoladenamens
Parameters
Stringname
The full name of the Accolade object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fAccolade. Returns the named fAccolade object.
getBookmark method
Finds the object for the named bookmark, if it exists.
getBookmarknamens
Parameters
Stringname
The full name of the bookmark to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fBookmark. Returns the named bookmark object.
getContexts method
Finds the named context set object, if it exists.
getContextsnamens
Parameters
Stringname
The full name of the context set object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fContexts. Returns the named context set object.
getControl method
Macro: "
Finds the named control object, if it exists.
getControlnamens
Parameters
Stringname
The full name of the control object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fControl. Returns the named control object.
getDocumentSequence method
Finds the named Document Sequence object, if it exists.
getDocumentSequencenamens
Parameters
Stringname
The full name of the Document Sequence object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fDocumentSequence. Returns the named fDocumentSequence object.
getFootnote method
Finds the named Footnote object, if it exists.
getFootnotenamens
Parameters
Stringname
The full name of the Footnote object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fFootnote. Returns the named fFootnote object.
getFrame method
Finds the named frame object, if it exists.
getFramenamens
Parameters
Stringname
The full name of the frame object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fFrame. Returns the named frame object.
getFunction method
Finds the function associated with the named JS Function tag, if it exists.
getFunctionnamens
Parameters
Stringname
The full name of the JS Function tag to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
Object. Returns the function associated with the named JS Function Tag object.
getGraphic method
Macro: "
Finds the named graphic object, if it exists.
getGraphicnamens
Parameters
Stringname
The full name of the graphic tag to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fGraphic. Returns the named graphic object.
getIndex method
Finds the named Index object, if it exists.
getIndexnamens
Parameters
Stringname
The full name of the Index object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fIndex. Returns the named fIndex object.
getLayer method
Finds the named layer object, if it exists.
getLayernamens
Parameters
Stringname
The full name of the layer object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fLayer. Returns the named layer object.
getLayerGroup method
Finds the named layer group object, if it exists.
getLayerGroupnamens
Parameters
Stringname
The full name of the layer group object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fLayerGroup. Returns the named layer group object.
getNamedColor method
Finds the named color object, if it exists.
getNamedColornametypens
Parameters
Stringname
The full name of the color object to find, including any PTC ALD namespaces.
inttype
The type of color object to find. Value is one of fContent.NamedColorTypes to only find a color of that type or -1 to find any named color object with the specified name.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fNamedColor. Returns the named color object.
getNamespace method
Macro: "
Finds the object for the specified PTC ALD namespace, if it exists.
getNamespacenamens
Parameters
Stringname
The full name of the PTC ALD namespace to find, including any parent PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fStream. Returns the specified fNamespace object.
getPDFAction method
Finds the PDF Action object, if it exists.
getPDFActionnamens
Parameters
Stringname
The full name of the PDF Action object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fPDFAction. Returns the PDF Action object.
getPDFFormItem method
Finds the PDF Form object, if it exists.
getPDFFormItemnametypens
Parameters
Stringname
The full name of the PDF Form object to find, including any PTC ALD namespaces.
inttype
The type of PDF Form object to find. Value is one of fContent.PDFFormItemTypes to only find a PDF Form item of that type or -1 to find any PDF Form item with the specified name.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fPDFFormItem. Returns the PDF Form object.
getPDFLayer method
Finds the PDF Layer object, if it exists.
getPDFLayernamens
Parameters
Stringname
The full name of the PDF Layer object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fPDFLayer. Returns the PDF Layer object.
getPDFMediaAssets method
Finds the PDF Media Assets object, if it exists.
getPDFMediaAssetsnamens
Parameters
Stringname
The full name of the PDF Media Assets object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fPDFMediaAssets. Returns the fPDFMediaAssets object.
getPDFU3DView method
Finds the PDF U3D View object, if it exists.
getPDFU3DViewnamens
Parameters
Stringname
The full name of the PDF U3D View object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fPDFU3DView. Returns the PDF U3D View object.
getPageSequence method
Finds the named Page Sequence object, if it exists.
getPageSequencenamens
Parameters
Stringname
The full name of the Page Sequence object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fPageSequence. Returns the named fPageSequence object.
getPublish method
Finds the named publish object, if it exists.
getPublishnamens
Parameters
Stringname
The full name of the publish object to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fPublish. Returns the named fPublish object.
getRaster method
Macro: "
Finds the named raster object, if it exists.
getRasternamens
Parameters
Stringname
The full name of the raster to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fRaster. Returns the named raster object.
getStream method
Macro: "
Finds the object for the named stream, if it exists.
getStreamnamens
Parameters
Stringname
The full name of the stream to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fStream. Returns the named stream object.
getTag method
Macro: "
Finds the object for the named tag, if it exists.
getTagnamens
Parameters
Stringname
The full name of the tag to find, including any PTC ALD namespaces.
fNamespacens
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fTag. Returns the named object, which will either be fStream, fGraphic, fRaster or fNamespace (depending on type).
gotoPage method
Macro: tpgoto
Moves to the page at that position in the template, making it the active page.
gotoPagepage
Parameters
fPagepage
The page number to move to, or one of fContent.GotoPagePosition to go to an adjacent page.
Returns
fPage. Returns the page object at the position selected.
importGraphic method
Macro: tfo *
Creates a new graphics object, loading the contents of the specified file into it.
importGraphicnamefilenametypelink
Parameters
Stringname
The name of the graphic object to create.
fPathfilename
The name and path of the file to be imported.
inttype
The type of graphic to import. Value must be one of the ones listed in fGraphic.GraphicType
booleanlink
If true, the file will be linked to the graphic object. Otherwise, the content will just be loaded into it.
Returns
fGraphic. The graphic object containing the loaded content, if successful.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
INVALID_TYPE: The tag already exists, but is not a valid graphic object.
fApplicationException
FILE_READ_ERROR: An error occurred reading from the file.
importJS method
Creates a new text stream and loads the contents of the specified file into it. Unlike the normal importText() method, if the link parameter is true the contents of the tag can be edited and will automatically be saved out to the source file with the document. The source script must either be standard ASCII or UNICODE.
importJSnamefilenamelinkfunction
Parameters
Stringname
The name of the text stream to create and load the content into. The type of stream will be fTag.TYPE_TEXT.
fPathfilename
The name and path of the file to be imported.
booleanlink
If true, the file will be linked to the text stream. Otherwise, the content will just be loaded into it.
booleanfunction
If true, the type of stream will be fTag.TYPE_JS_FUNCTION, otherwise it will be fTag.TYPE_JS_SCRIPT
Returns
fStream. The text stream containing the loaded content, if successful.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
INVALID_TYPE: The tag already exists, but is not a valid stream object.
fApplicationException
FILE_READ_ERROR: An error occurred reading from the file.
importRaster method
Macro: tfr *
Creates a new raster object, loading the contents of the specified file into it.
importRasternamefilenametypelinkpagepdfboxlowreslowresMaxXlowresMaxY
Parameters
Stringname
The name of the raster object to create.
fPathfilename
The name and path of the file to be imported.
inttype
The type of raster to import. Value must be one of the ones listed in fRaster.RasterType
booleanlink
If true, the file will be linked to the raster object. Otherwise, the content will just be loaded into it. This parameter defaults to true.
intpage
The page number to import, if the raster being imported is a PDF file. This value starts from 1 for the first page.
intpdfbox
The PDF box to use, if the raster being imported is a PDF file. Value must be one of the ones listed in fRaster.PDFBoxType
intlowres
Whether the image should be imported at a lower resolution for displaying on screen. Value must be one of the ones listed in fRaster.LowresModes. This parameter defaults to fRaster.LOWRES_NONE.
intlowresMaxX
If lowres is fRaster.LOWRES_RESOLUTION, the maximum number of horizontal pixels allowed in the imported raster. If lowres is fRaster.LOWRES_FILESIZE, the maximum amount of memory allowed in kilobytes.
intlowresMaxY
If lowres is fRaster.LOWRES_RESOLUTION, the maximum number of vertical pixels allowed in the imported raster. If lowres is fRaster.LOWRES_FILESIZE, this parameter is ignored.
Returns
fRaster. The raster object containing the loaded content, if successful.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
INVALID_TYPE: The tag already exists, but is not a valid raster object.
fApplicationException
FILE_READ_ERROR: An error occurred reading from the file.
importText method
Macro: tft *
Creates a new text stream and loads the contents of the specified file into it.
importTextnamefilenamelinkoptions
Parameters
Stringname
The name of the text stream to create and load the content into. The type of stream will be fTag.TYPE_TEXT.
fPathfilename
The name and path of the file to be imported.
booleanlink
If true, the file will be linked to the text stream. Otherwise, the content will just be loaded into it.
Stringoptions
The options for loading the text stream, taken from the tft macro. Defaults to exact copy ("1eutyj").
Returns
fStream. The text stream containing the loaded content, if successful.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
INVALID_TYPE: The tag already exists, but is not a valid stream object.
fApplicationException
FILE_READ_ERROR: An error occurred reading from the file.
insertPage method
Macro: tpinsert
Creates the specified number of new pages, adding them to the template after the current page.
insertPagewidthheightlayersnum_pages
Parameters
fLengthwidth
The width of the page to create.
fLengthheight
The height of the page to create.
fLayerGrouplayers
The set of layers to add to the page after creating it, or null for the page to be created empty. If this parameter is not provided or undefined, the frames on the current page will be copied following the frame.copyMode parameter.
intnum_pages
The number of pages to create. If not provided, only 1 page will be created.
Returns
fPage. Returns the first newly created fPage object.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
loadNamespace method
Macro: tnload
Loads a namespace and its contents into the current template.
loadNamespacenamefilenamelinkrunAutoexecmerge
Parameters
Stringname
The name of the namespace object to load the content into. If the object does not exist, it will be created. If this name is different to the namespace contained in the source file, the content tags will automatically be renamed.
fPathfilename
The name and path of the file from which the namespace will be loaded.
booleanlink
If true, the file will be linked to the namespace object. Otherwise, the content will just be loaded into it.
booleanrunAutoexec
If true, the autoexec script in the file will be run if present.
intmerge
How to handle clashes between tags in the namespace and tags already existing in the template. Values are in fContent-NamespaceMergeModes.
Returns
fNamespace. The namespace object containing the loaded content, if successful.
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
INVALID_TYPE: The tag already exists, but is not a valid namespace object.
fApplicationException
FILE_READ_ERROR: An error occurred reading from the file.
renameTag method
Macro: ttagren
Renames the named tag. Any existing pages or frames that use this tag will have the references updated. Other references in scripts or styles will ignored unless the updateText parameter is selected.
renameTagfromtofromnstonsupdateText
Parameters
Stringfrom
The full name of the tag to rename, including any PTC ALD namespaces. This name can contain a wildcard to rename multiple tags.
Stringto
The full name of the tag to rename, including any PTC ALD namespaces. This name can contain a wildcard to rename multiple tags.
fNamespacefromns
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
fNamespacetons
The PTC ALD namespace to search for the tag in. If not provided, the root namespace will be used.
booleanupdateText
If true, a search and replace will automatically be performed, replacing any references to the old name of this tag with the new name. Note that this action may not always be accurate, depending on the complexity of the template. This property defaults to false.
Returns
fTag. Returns the named object, which will either be fStream, fGraphic, fRaster or fNamespace (depending on type).
Throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
runStream method
Macro: trun
Runs the named stream, if it is a valid JS, Perl or PTC ALD miniscript.
runStreamtag
Parameters
fStreamtag
The stream to run.
Returns
void. None.