comet.CDocLink¶
- class comet.CDocLink¶
This section describes all functions for the CDocLink class.
CDocLink represents a document link between a frame and an image. It is used to query information and update or change image links in a document.
Methods¶
- CDocLink.getFrame()¶
Get the owning frame of this document link.
- Returns:
The owning frame of this link.
- Return type:
- Available:
InDesign® comet_pdf®
- Raises:
CometError – On internal error
- CScript:
- CDocLink.getState()¶
Get the state of this link.
- Returns:
The state of this link.
-1 : Error
0 : Link is up-to-date and available for use.
1 : Link is out-of-date and needs to be updated
2 : Link resource is embedded, and link is up-to-date.
3 : Link resource is cached, and link is up-to-date.
4 : Link resource is contained, and link is up-to-date.
5 : Link resource is missing.
6 : Link resource is not accessible by the user.
7 : Link resource state is pending an update.
8 : Link resource state cannot be determined.
- Return type:
- Available:
InDesign® comet_pdf®
- Raises:
CometError – On internal error
- CScript:
- CDocLink.getType()¶
Determine the type of a this link.
InDesign® In addition to links to images, InDesign® can create links to text frames too, use the menu Edit -> Place and Link to do that.
comet_pdf® Links to text frames are not supported by comet_pdf!
- Returns:
The type of this link.
-1 : Error
0 : Internal
1 : Text Frame
2 : Image
- Return type:
- Available:
InDesign® comet_pdf®
- Raises:
CometError – On internal error
- CScript:
- CDocLink.getPath()¶
Get the complete path of this link.
- Returns:
The full path to the link.
The result depends on the type of the link, see
getType()
:Internal : UID of the text frame (as
str
), InDesign® onlyImage : Full path to the linked image
Text Frame : Empty (‘’), InDesign® only
Embedded images with a reference to their original file provide the path of this original file.
- Return type:
- Available:
InDesign® comet_pdf®
- Raises:
CometError – On internal error
- CScript:
- CDocLink.update()¶
Update the link by reimporting the data. The update uses the setting last used to import the data. If this fails because the data is no longer appropriate for this import filter, the import uses the standard import code which picks a new filter.
- Return type:
None
- Available:
InDesign®
- Raises:
CometError – On internal error
- CScript:
- CDocLink.relink(path)¶
Import a new image into the link. The function behaves like
CFrame.setImage()
with the parameter alignment set toconstants.kPlaceLikeExisting
.- Parameters:
path (str) – Full path to the new image.
- Return type:
None
- Available:
InDesign® comet_pdf®
- CScript: