Référence FOM > 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
fNamedColor[]
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[]
documentSequences attribute
This is a read only array of all document sequence objects stored in the template.
documentSequences
Access
read-only
Returns
fDocumentSequence[]
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
fFont[]
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 LD namespace objects stored in the template.
namespaces
Access
read-only
Returns
fNamespace[]
pageSequences attribute
This is a read only array of all page sequence objects stored in the template.
pageSequences
Access
read-only
Returns
fPageSequence[]
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
fPDFAction[]
pdfFormItems attribute
This is a read only array of all PDF Form objects stored in the template.
pdfFormItems
Access
read-only
Returns
fPDFFormItem[]
pdfLayers attribute
This is a read only array of all PDF Layer objects stored in the template.
pdfLayers
Access
read-only
Returns
fPDFLayer[]
pdfMediaAssets attribute
This is a read only array of all PDF Media Assets objects stored in the template.
pdfMediaAssets
Access
read-only
Returns
fPDFMediaAssets[]
pdfU3DViews attribute
This is a read only array of all PDF Form objects stored in the template.
pdfU3DViews
Access
read-only
Returns
fPDFU3DView[]
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[]
rules attribute
This is a read only array of all rule objects stored in the template.
rules
Access
read-only
Returns
fRules[]
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.
copyTag from to fromns tons
Parameters
String from
The full name of the source tag to copy, including any LD namespaces.
String to
The name of the new tag to create.
fNamespace fromns
The LD namespace to search for the tag in. If not provided, the root namespace will be used.
fNamespace tons
The LD 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.
createAccolade name ns
Parameters
String name
The name of the Accolade object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createBarcode name width height foregroundColor backgroundColor barcode value
Parameters
String name
The name of the graphic tag to create and generate the barcode into. The type of stream will be fTag.TYPE_GRAPHIC.
fLength width
The width of the barcode.
fLength height
The height of the barcode.
fColor foregroundColor
The foreground color to use for the barcode.
fColor backgroundColor
The background color to use for the barcode.
fBarcode barcode
Either an fBarcode object containing the properties of the barcode, or an integer from fBarcode.BarcodeTypes specifying the type of barcode to create.
String value
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.
createBookmark name ns
Parameters
String name
The name of the tag to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createContexts name ns
Parameters
String name
The name of the context set object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createControl name type ns
Parameters
String name
The name of the control object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
int type
The type of object to create. This must be one of the control object types listed in fControl.ControlType.
fNamespace ns
The LD 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.
createDocumentSequence name ns
Parameters
String name
The name of the Document Sequence object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createFootnote name ns
Parameters
String name
The name of the Footnote object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createFrame name ns
Parameters
String name
The name of the frame object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createFunction name function ns
Parameters
String name
The name of the tag to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
Object function
A string containing JavaScript source code for the function to associate with the new tag, or a JavaScript Function object.
fNamespace ns
The LD 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.
createGraphicFromSVG method
Creates an fGraphic tag by importing the content of the specified SVG node.
createGraphicFromSVG graphic svg pdfPassthrough pxToMm useDocumentSize fitX fitY preserveAspectRatio defaultLineWidth ellipseAccuracy
Parameters
String graphic
The name of the output graphic tag to create.
fxNode svg
The SVG root node to import.
boolean pdfPassthrough
If true, the SVG content used will be passed directly through to the PDF output driver instead of drawing the graphic tag.
float pxToMm
The conversion value to use when converting pixel units to mm.
boolean useDocumentSize
If true, the width and height specified in the SVG will be used to size the graphic.
fLength fitX
The width of the graphic to use if useDocumentSize is not set.
fLength fitY
The height of the graphic to use if useDocumentSize is not set.
boolean preserveAspectRatio
If true, the graphic will retain the specified aspect ratio when fitting inside the width and height.
fLength defaultLineWidth
The default line thickness to use if not specified in the SVG.
int ellipseAccuracy
The number of line segments to use when simulating ellipse curves.
Returns
fGraphic. The graphic containing the imported SVG.
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.
createIndex name ns
Parameters
String name
The name of the Index object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createLayer name underlay ns
Parameters
String name
The name of the layer object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
boolean underlay
If true, the layer will be created as an underlay, otherwise it will be an overlay.
fNamespace ns
The LD 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.
createLayerGroup name ns
Parameters
String name
The name of the layer group object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createNamedColor color type ns
Parameters
String color
The name of the color object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
int type
The type of the color object to create. Value is one of fContent.NamedColorTypes or defaults to creating a named color.
fNamespace ns
The LD 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 LD 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.
createNamespace name ns
Parameters
String name
The name of the LD namespace to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createPDFAction layer ns
Parameters
String layer
The name of the PDF Action object to create. If the name contains a colon, the tag will be created in the specified LD namespace.
fNamespace ns
The LD 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.
createPDFFormItem name type ns
Parameters
String name
The name of the PDF Form object to create. If the name contains a colon, the tag will be created in the specified LD namespace.
int type
The type of PDF Form object to create. Value is one of fContent.PDFFormItemTypes to create a PDF Form item of that type.
fNamespace ns
The LD 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.
createPDFLayer layer ns
Parameters
String layer
The name of the PDF Layer object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createPDFMediaAssets layer ns
Parameters
String layer
The name of the PDF Media Assets object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createPDFU3DView layer ns
Parameters
String layer
The name of the PDF U3D View object to create. If the name contains a colon, the tag will be created in the specified LD namespace.
fNamespace ns
The LD 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.
createPageChecksumReport report mode baseReport startPage endPage lineElement pageNumberElement pageReformatElement formatElement printElement pageShowString
Parameters
String report
The name of the stream to write the report into. If this stream already exists, it will be overwritten.
int mode
Which type of report to create. Possible values are in fContent.PageChecksumModes.
fStream baseReport
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.
int startPage
The first page to include in the report.
int endPage
The last page to include in the report.
String lineElement
The name of the element to wrap each line in the report. This defaults to "ck_line".
String pageNumberElement
The name of the element to wrap each page number in the report. This defaults to "ck_page".
String pageReformatElement
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".
String formatElement
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".
String printElement
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".
String pageShowString
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.
createPageSequence name ns
Parameters
String name
The name of the Page Sequence object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createPublish name ns
Parameters
String name
The name of the publish object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD 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.
createRules method
Creates a rules 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.
createRules name ns
Parameters
String name
The name of the rules object to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
fNamespace ns
The LD namespace to create the tag in. If not provided, the root namespace will be used.
Returns
fRules. Returns the newly created fRules 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.
createStoredObject name obj ns
Parameters
String name
The name of the stored object tag to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
Object obj
The object to store in the new tag.
fNamespace ns
The LD 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.
createStream name type ns
Parameters
String name
The name of the tag to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
int type
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.
fNamespace ns
The LD 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.
createTag name type ns
Parameters
String name
The name of the tag to create. If the name contains a colon, the tag will be created in the specified LD namespace. Otherwise, the name must follow standard LD naming conventions.
int type
What type of tag to create. The list of possible tag types is available in fTag.TagType.
fNamespace ns
The LD 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.
deletePage num_pages
Parameters
int num_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.
deleteTag name ns updateText replaceText keepFrame
Parameters
String name
The full name of the tag to delete, including any LD namespaces. This name can contain a wildcard to delete multiple tags.
fNamespace ns
The LD namespace to search for the tag in. If not provided, the root namespace will be used.
boolean updateText
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.
String replaceText
The text to use if updateText is true.
boolean keepFrame
If true, and the tag is either a frame or namespace containing frame tags, any frames that use this tag will be preserved on the page as an anonymous frame.
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.
getAccolade name ns
Parameters
String name
The full name of the Accolade object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getBookmark name ns
Parameters
String name
The full name of the bookmark to find, including any LD namespaces.
fNamespace ns
The LD 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.
getContexts name ns
Parameters
String name
The full name of the context set object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getControl name ns
Parameters
String name
The full name of the control object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getDocumentSequence name ns
Parameters
String name
The full name of the Document Sequence object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getFootnote name ns
Parameters
String name
The full name of the Footnote object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getFrame name ns
Parameters
String name
The full name of the frame object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getFunction name ns
Parameters
String name
The full name of the JS Function tag to find, including any LD namespaces.
fNamespace ns
The LD 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.
getGraphic name ns
Parameters
String name
The full name of the graphic tag to find, including any LD namespaces.
fNamespace ns
The LD 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.
getIndex name ns
Parameters
String name
The full name of the Index object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getLayer name ns
Parameters
String name
The full name of the layer object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getLayerGroup name ns
Parameters
String name
The full name of the layer group object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getNamedColor name type ns
Parameters
String name
The full name of the color object to find, including any LD namespaces.
int type
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.
fNamespace ns
The LD 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 LD namespace, if it exists.
getNamespace name ns
Parameters
String name
The full name of the LD namespace to find, including any parent LD namespaces.
fNamespace ns
The LD 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.
getPDFAction name ns
Parameters
String name
The full name of the PDF Action object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getPDFFormItem name type ns
Parameters
String name
The full name of the PDF Form object to find, including any LD namespaces.
int type
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.
fNamespace ns
The LD 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.
getPDFLayer name ns
Parameters
String name
The full name of the PDF Layer object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getPDFMediaAssets name ns
Parameters
String name
The full name of the PDF Media Assets object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getPDFU3DView name ns
Parameters
String name
The full name of the PDF U3D View object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getPageSequence name ns
Parameters
String name
The full name of the Page Sequence object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getPublish name ns
Parameters
String name
The full name of the publish object to find, including any LD namespaces.
fNamespace ns
The LD 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.
getRaster name ns
Parameters
String name
The full name of the raster to find, including any LD namespaces.
fNamespace ns
The LD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fRaster. Returns the named raster object.
getRules method
Finds the named rules object, if it exists.
getRules name ns
Parameters
String name
The full name of the rules object to find, including any LD namespaces.
fNamespace ns
The LD namespace to search for the tag in. If not provided, the root namespace will be used.
Returns
fRules. Returns the named rules object.
getStream method
Macro: "
Finds the object for the named stream, if it exists.
getStream name ns
Parameters
String name
The full name of the stream to find, including any LD namespaces.
fNamespace ns
The LD 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.
getTag name ns
Parameters
String name
The full name of the tag to find, including any LD namespaces.
fNamespace ns
The LD 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.
gotoPage page
Parameters
fPage page
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.
importGraphic name filename type link
Parameters
String name
The name of the graphic object to create.
fPath filename
The name and path of the file to be imported.
int type
The type of graphic to import. Value must be one of the ones listed in fGraphic.GraphicType
boolean link
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.
importJS name filename link function
Parameters
String name
The name of the text stream to create and load the content into. The type of stream will be fTag.TYPE_TEXT.
fPath filename
The name and path of the file to be imported.
boolean link
If true, the file will be linked to the text stream. Otherwise, the content will just be loaded into it.
boolean function
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.
importRaster name filename type link page pdfbox lowres lowresMaxX lowresMaxY
Parameters
String name
The name of the raster object to create.
fPath filename
The name and path of the file to be imported.
int type
The type of raster to import. Value must be one of the ones listed in fRaster.RasterType
boolean link
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.
int page
The page number to import, if the raster being imported is a PDF file. This value starts from 1 for the first page.
int pdfbox
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
int lowres
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.
int lowresMaxX
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.
int lowresMaxY
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.
importText name filename link options
Parameters
String name
The name of the text stream to create and load the content into. The type of stream will be fTag.TYPE_TEXT.
fPath filename
The name and path of the file to be imported.
boolean link
If true, the file will be linked to the text stream. Otherwise, the content will just be loaded into it.
String options
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.
insertPage width height layers num_pages
Parameters
fLength width
The width of the page to create.
fLength height
The height of the page to create.
fLayerGroup layers
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.
int num_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.
loadNamespace name filename link runAutoexec merge
Parameters
String name
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.
fPath filename
The name and path of the file from which the namespace will be loaded.
boolean link
If true, the file will be linked to the namespace object. Otherwise, the content will just be loaded into it.
boolean runAutoexec
If true, the autoexec script in the file will be run if present.
int merge
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.
renameTag from to fromns tons updateText
Parameters
String from
The full name of the tag to rename, including any LD namespaces. This name can contain a wildcard to rename multiple tags.
String to
The full name of the tag to rename, including any LD namespaces. This name can contain a wildcard to rename multiple tags.
fNamespace fromns
The LD namespace to search for the tag in. If not provided, the root namespace will be used.
fNamespace tons
The LD namespace to search for the tag in. If not provided, the root namespace will be used.
boolean updateText
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 LD miniscript.
runStream tag
Parameters
fStream tag
The stream to run.
Returns
void. None.
saveNamespace method
Macro: tnsave
Saves a namespace and its contents into the specified file.
saveNamespace name filename
Parameters
fNamespace name
The namespace object to save.
fPath filename
The name and path of the file to save the namespace into.
Returns
void. None.
saveNamespaceLE method
Macro: tnsavele
Saves the namespace in a protected ".3ln" format that can be loaded by ALE.
saveNamespaceLE name filename
Parameters
fNamespace name
The namespace object to save.
fPath filename
The name and path of the file to save the namespace into.
Returns
void. None.
Est-ce que cela a été utile ?