FOM Reference > Content > Tags > fTag interface
  
fTag interface
This object contains the base properties for all tags. This object isn't intended to be used directly, but is instead inherited by all other Content objects.
TagClasses enumeration
Describes what class of tag the object refers to.
The TagClasses enumeration has the following constants of type int.
CLASS_TEXT = 0
This tag contains text data, and will be or store a reference to a fStream object.
CLASS_OBJECT = 1
This tag contains graphic data, and will be or store a reference to a fGraphic object.
CLASS_RASTER = 2
This tag contains image data, and will be or store a reference to a fRaster object.
CLASS_PAGE = 3
This tag describes a page layout, and will be or store a reference to either a fPage or fLayer object.
CLASS_BOOKMARK = 5
This tag contains bookmarks, and will be or store a reference to a fBookmark object.
CLASS_FONT = 6
This tag contains font data, and will be or store a reference to a fFont object.
CLASS_NAMESPACE = 7
This tag is an PTC ALD namespace, and is a fNamespace object.
TagLinkFormat enumeration
The list of possible values for the link_format parameter of fTag.link
The TagLinkFormat enumeration has the following constants of type int.
LINKFORMAT_NONE = 0
No link will be created.
LINKFORMAT_ORIGINAL = 1
The original file format when the content was imported will be used.
LINKFORMAT_APP = 2
A native PTC ALD file format will be used, depending on the tag class.
LINKFORMAT_APP_SCRIPT = 4
If the tag class is TYPE_TEXT, the file format will be plain text.
TagLinkType enumeration
This describes the status of the link.
The TagLinkType enumeration has the following constants of type int.
LINK_NOTLOADED = 0
The link has been created, but the content has either not yet been loaded from the source file, or loading failed.
LINK_LOADED = 1
The content has been successfully loaded.
LINK_TAGCHANGED = 2
The contents of the tag are more recent than the source file.
LINK_FILECHANGED = 3
The contents of the source file are more recent than the tag.
TagType enumeration
This describes the different types of tags.
The TagType enumeration has the following constants of type int.
TYPE_TEXT = 0
A text tag (.tx)
TYPE_STYLE = 1
A style tag (.st)
TYPE_REF = 2
A reference tag (.rf)
TYPE_GRAPHIC = 3
An object graphic tag (.og)
TYPE_RASTER = 4
A raster tag (.rg)
TYPE_PAGE = 5
A page tag (.pg)
TYPE_FOOTNOTE = 6
A footnote tag (.fn)
TYPE_BULLET = 7
A bullet item tag (.bu)
TYPE_EXCEPTION_DICT = 8
An exception dictionary (.ex)
TYPE_KERN = 9
A kerning table (.ke)
TYPE_LIGATURES = 10
A ligatures table (.lg)
TYPE_INDEX = 11
An index tag (.ix)
TYPE_INDEX_CTRL = 12
An index control stream (.ic)
TYPE_CONTENTS = 13
A table of contents tag (.co)
TYPE_CONTENTS_CTRL = 14
A contents control stream (.cc)
TYPE_PRINT_CTRL = 15
An imposition printer control stream (.pc)
TYPE_GRAPHICS_TEXT = 16
A graphics text tag (.gt)
TYPE_COMMENT = 17
A comments tag (.cm)
TYPE_APP_SCRIPT = 20
An APP script (.sc)
TYPE_DICTIONARY = 21
A dictionary tag (.di)
TYPE_TeX_DEF = 22
A TeX tag (.td)
TYPE_ANCHOR_CTRL = 27
An anchor control stream (.ac)
TYPE_FOOTNOTE_CTRL = 28
A footnote control stream (.fc)
TYPE_PASTEBOARD = 31
A pasteboard control tag (.pb)
TYPE_COLOR = 32
A color control stream (.cl)
TYPE_BOOKMARK = 33
A bookmark tag (.mk)
TYPE_RULE = 35
A rule control stream (.ru)
TYPE_REVISIONMARK_CTRL = 36
A revision mark control stream (.rc)
TYPE_AUTO_FOOTNOTES = 37
An automatically generated footnote tag (.xf)
TYPE_PAGERULE_CTRL = 40
A page rule control stream (.pr)
TYPE_FONT = 52
A font tag (.fn)
TYPE_ACCOLADE_CTRL = 53
An accolade control stream (.al)
TYPE_TRUETYPE_FONT = 54
A TrueType font tag (.ft)
TYPE_NAMESPACE = 55
A namespace tag (.ns)
TYPE_VIEW_CTRL = 56
A view control stream (.vc)
TYPE_PERL_SCRIPT = 58
A perl script (.pl)
TYPE_XML = 59
An XML stream (.xm)
TYPE_XSLT = 60
An XSLT stream (.xs)
TYPE_UNDERLAY = 61
A page underlay tag (.pu)
TYPE_OVERLAY = 62
A page overlay tag (.po)
TYPE_IMPOSITION = 63
An imposition control stream (.pi)
TYPE_FONT_TABLE = 64
A quickfont control stream (.qt)
TYPE_PAGE_SEQUENCE_CTRL = 65
A page sequence control stream (.ps)
TYPE_DOCUMENT_SEQUENCE_CTRL = 66
A document control stream (.ds)
TYPE_TRYTABLE = 67
A trytable control stream (.tt)
TYPE_XML_ERROR = 69
An XML error stream (.xe)
TYPE_CSS = 70
A CSS control stream (.cs)
TYPE_PUBLISH_CTRL = 71
A publish control stream (.sp)
TYPE_PROPERTY_INHERIT_cTRL = 72
A property inheritance control stream (.ip)
TYPE_DOCUMENT_PROPERTY_CTRL = 73
A document property control stream (.dp)
TYPE_JS_SCRIPT = 74
A JS script (.js)
TYPE_PSEUDOFONT_CTRL = 75
A pseudofont control stream (.fp)
TYPE_LINE_CTRL = 76
A line control stream (.li)
TYPE_LINE_PATTERN_CTRL = 77
A line pattern control stream (.lp)
TYPE_LINE_SEGMENT_CTRL = 78
A line segment control stream (.ls)
TYPE_UNIPAIR_TABLE = 79
A unipair table (.up)
TYPE_XML_TREE = 80
An XML tree (.xd)
TYPE_EDITOR_TREE = 81
An Editor XML tree (.ep)
TYPE_STYLER = 82
A Styler XML tree (.sy)
TYPE_CONTEXT_CTRL = 83
A context control stream (.cx)
TYPE_STRIPSPACE_CTRL = 84
A stripspace control stream (.ss)
TYPE_XML_NODESET = 85
An XML nodeset (.xn)
TYPE_EDITOR_NODESET = 86
An Editor XML nodeset (.en)
TYPE_NODESET_CTRL = 87
A nodeset control stream (.nc)
TYPE_FRAME = 88
A frame control stream (.fr)
TYPE_LAYERGROUP = 89
A layergroup control stream (.pd)
TYPE_JS_FUNCTION = 90
A JS function (.jf)
TYPE_INDEX_GROUP_CTRL = 91
An index group control stream (.gr)
TYPE_PDF_TAG_CTRL = 92
A PDF Tag control stream (.tg)
TYPE_PDF_TAG_ROLEMAP = 93
A PDF Tag Role map control stream (.tr)
TYPE_JS_PRINTER_CTRL = 94
A JS Printer control stream (.jp)
TYPE_PDF_LAYER_CTRL = 95
A PDF Layer control stream (.py)
TYPE_JS_OBJECTS = 97
JavaScript objects (.jo)
TYPE_PDF_MEDIA_ASSETS = 98
PDF Media Asset objects (.pm)
TYPE_PDF_FORM_ITEM = 99
PDF Form Item objects (.px)
TYPE_PDF_ACTION = 100
PDF Action objects (.pa)
TYPE_PDF_U3DVIEW = 101
PDF U3D View objects (.pv)
formatting attribute
Formatting user properties. These properties will get reset at the start of a full format.
formatting
Access
read-only
Returns
fStringArray
fullname attribute
Macro: ttagren
The full name of the tag, including all PTC ALD namespaces.
fullname
Access
read-write
Returns
String
Set throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
isProtected attribute
If true, the tag is protected from changes.
isProtected
Access
read-only
Returns
boolean
linkPath attribute
If the tag is a link to a file, this contains the full path to the file.
linkPath
Access
read-only
Returns
fPath
linkType attribute
If the tag is a link to a file, this property shows whether it has loaded or not.
linkType
Access
read-only
Returns
int
name attribute
Macro: ttagren
The name of the tag, not including any PTC ALD namespaces. This name should be unique across all other tags in the same namespace. It is possible to rename the tag by changing this name. An exception will be thrown if a tag of the same name already exists.
name
Access
read-write
Returns
String
Set throws
fContentException
TEMPLATE_READONLY: The template is read only and cannot be changed.
TAG_EXISTS: A tag of the same name already exists.
namespace attribute
The parent PTC ALD namespace for this object. If it is null, then the tag is in the root namespace.
namespace
Access
read-write
Returns
fNamespace
readonly attribute
Read only user properties. These properties can only be changed when PTC ALD is not formatting the template.
readonly
Access
read-only
Returns
fStringArray
tagClass attribute
The class of tag, i.e. if it is a stream, graphic or raster, for example. Is one of the values in fTag.TagClasses
tagClass
Access
read-only
Returns
int
temp attribute
Temporary user properties. These properties will not get saved with the template.
temp
Access
read-only
Returns
fStringArray
type attribute
Macro: ttagren
The type of tag this is, and is one of the values in fTag.TagType.
type
Access
read-write
Returns
int
Set throws
fContentException
INVALID_TYPE: The type of tag is not suitable for the available content.
user attribute
User defined properties.
user
Access
read-only
Returns
fStringArray
copyTag method
Macro: ttagcopy
Copies the contents of this tag into the named tag.
copyTagnamens
Parameters
Stringname
The name of the tag to copy into, including PTC ALD namespaces if required. This tag must not already exist, otherwise an exception will be raised.
fNamespacens
The PTC ALD namespace to create the new 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.
INVALID_TYPE: The type of tag is not suitable for the available content.
deleteTag method
Macro: ttagdel
Deletes this 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.
deleteTagupdateTextreplaceText
Parameters
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.
link method
Macro: tlink
Creates a link between this tag and a source file. Note that this doesn't automatically import or save the contents of the tag into the file. To achieve this, either fTag.updateLink() or fTag.saveLink() should be called manually after the link is created.
linkfilenametype
Parameters
fPathfilename
The full name and path of the file to link to. If this is left blank, the link will be broken.
inttype
The type of link to create. This value is one of fTag.TagLinkFormat. Unless the contents of the tag were loaded into PTC ALD using the import methods, this will be set to fTag.LINKFORMAT_PTC ALD.
Returns
void. None
Throws
fApplicationException
FILE_WRITE_ERROR: An error occurred creating the file.
fContentException
INVALID_TYPE: This type of tag is not suitable for linking.
readResolve method
Return the fTag object corresponding to the given serialized representation.
readResolveobj
Parameters
Objectobj
The serialized representation.
Returns
fTag. The tag corresponding to the serialized representation.
renameTag method
Macro: ttagren
Renames this 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.
renameTagnamensupdateText
Parameters
Stringname
The new name of the tag.
fNamespacens
The PTC ALD namespace to create the new 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 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.
INVALID_TYPE: The type of tag is not suitable for the available content.
saveLink method
Macro: tlsave
Saves the contents of the tag to the source file. The format used to save the tag will depend upon the link type specified when creating the link.
saveLinkforcenoCheck
Parameters
booleanforce
If false, only save the content if it has been changed inside PTC ALD. Otherwise, save the content regardless.
booleannoCheck
If false, the content will only be saved if the content is less recent than the linked file. Otherwise, save the content regardless.
Returns
void. None
Throws
fContentException
TAG_NOT_LINKED: The tag is not linked to a file.
LINK_TOO_OLD: The contents of the tag are more recent than the link, and noCheck was false.
fApplicationException
FILE_WRITE_ERROR: An error occurred writing to the file.
updateLink method
Macro: tlupdate
Reloads the content of this tag from its source file. The format used to load the content will depend upon the link type specified when creating the link.
updateLinkforcenoCheckbreakLink
Parameters
booleanforce
If false, only reload the content if the file has been changed after the last load. Otherwise, load the content regardless.
booleannoCheck
If false, the content will only be loaded if the content is less recent than the linked file. Otherwise, load the content regardless.
booleanbreakLink
If false, the link will remain after updating. Otherwise, the link will be broken.
Returns
void. None
Throws
fContentException
TAG_NOT_LINKED: The tag is not linked to a file.
LINK_TOO_OLD: The contents of the tag are more recent than the link, and noCheck was false.
fApplicationException
FILE_READ_ERROR: An error occurred reading from the file.
writeReplace method
Create a serializable representation of this tag.
writeReplace
Parameters
None
Returns
Object. A serializable representation of this tag.