Main Content

mlreportgen.dom.InternalLink class

Package:mlreportgen.dom
Superclasses:

Hyperlink to a location in same document

Description

Hyperlink to a location in the same document that contains the hyperlink. Use this kind of link to provide internal navigation within a document.

Construction

internalLinkObj= InternalLink(targetName,linkText)creates a hyperlink to the specified link target object and uses the specified link text.

internalLinkObj= InternalLink(targetName,linkText,linkTextStyleName)creates a hyperlink to the specified link target and uses the specified style name for the link text.

internalLinkObj= InternalLink(targetName,textObj)creates a hyperlink to the specified target using the specified文本object.

Input Arguments

expand all

Link target name, specified as character vector. The character vector is the value in theNameproperty of anmlreportgen.dom.LinkTargetobject or a URL.

The text to use for the link text.

Name of style to use for the link text.

文本object containing link text, specified by anmlreportgen.dom.Textobject.

Output Arguments

expand all

Internal link, represented by anmlreportgen.dom.InternalLinkobject.

Properties

expand all

Children of this document element, specified as an array of DOM objects. This property is read-only.

Custom attributes of this document element, specified as an array ofmlreportgen.dom.CustomAttribute对象. The custom attributes must be supported by the output format.

ID for this document element, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Parent of this document element, specified as a DOM object. This property is read-only.

Name of link style defined in the template, specified as a character vector. The style specified bystyleNamemust be defined in the template used to create the document to which the link is appended.

Format objects that specify the format of a document element.

Tag for this document element, specified as a character vector or string scalar.

The DOM generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of theIdproperty of the object. Specifying your own tag value can help you to identify where an issue occurred during document generation.

这read-only property displays the link target of this hyperlink.

Methods

Method

Purpose

append

UseInternalLink.appendin a similar way to how you useExternalLink.append.

Append text or a文本,Image, orCustomElementobject.

clone

UseInternalLink.clonein a similar way to how you useParagraph.clone.

Copy the internal link.

Examples

collapse all

Link to a target in the same document by using anmlreportgen.dom.LinkTargetobject to define the link target and anmlreportgen.dom.InternalLinkobject to define the link. The link target name associates the link with the link target. To generate a link target name that is valid for all report types, usemlreportgen.utils.normalizeLinkID.

importmlreportgen.dom.*importmlreportgen.utils.*d = Document(“mydoc”,'pdf');% Append a link target to a headingh = Heading(1,'Author''s Biography'); h.Style = {PageBreakBefore(true)}; linkID = normalizeLinkID('bio'); append(h,LinkTarget(linkID));% Link to the targetappend(d,InternalLink(linkID,'About the Author'));% Append the headingappend(d,h); close(d); rptview(d);