ImageCollection Object
Description
Contains all images of a Text Control document or part of the document.
Syntax
ImageCollectionExamples
The following example demonstrates ImageCollection in a practical document-editing workflow. It contains all images of a Text Control document or part of the document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.images.getItem(
function(image) {
if (!image) {
console.warn("No image was returned.");
return;
}
console.log("get item result:", image);
},
onTxError,
25
);Members
Methods
| Method | Description |
|---|---|
| addAnchored | Creates and inserts a new image which is anchored to the specified text position. It has the specified horizontal alignment and a textflow which is given through the insertionMode parameter. Anchored image are moved with the text. |
| addAnchoredAtLocation | Inserts a new image which is anchored to the specified text position. It has the specified location relative to the paragraph it is anchored to and a textflow which is given through the insertionMode parameter. Anchored images are moved with the text. |
| addAtFixedPosition | Obsolete. This method will be removed in one of the next versions. Inserts a new image which has a fixed geometrical position in the document. This position is specified through a page number and a location on this page. |
| addAtFixedPositionInDocument | Creates and inserts a new image which has a fixed geometrical position in the document. This position is specified through a location relative to the top left corner of the complete document. All gaps between the pages must be included. |
| addAtFixedPositionOnPage | Inserts a new image which has a fixed geometrical position in the document. This position is specified through a page number and a location on this page. |
| addInline | Creates and inserts a new image inline, which means that it is treated in the text like a single character. The image is inserted at the specified text input position. |
| clear | Removes all objects from the collection and from the document. (Inherited from FrameBaseCollection.) |
| getItem | Gets the image selected by the user or the image with the specified identifier. |
| getItemByName | Gets the image with the specified name. |
| remove | Removes an image from a Text Control document. |