runLinkTarget Method

Summary

Invokes the specified document link target.

Syntax

JavaScript Syntax
DocumentViewer.prototype.runLinkTarget = function( 
   linkTarget 
) 
TypeScript Syntax
runLinkTarget( 
   linkTarget: DocumentLinkTarget 
): void; 

Parameters

linkTarget

Properties of the link target to invoke

Remarks

RunLinkTarget is called internally by the document viewer and can be invoked by the user to perform the action specified by a DocumentLinkTarget object.

It is called internally when any of the following occur:

The application can also create a custom DocumentLinkTarget that does not exist in the document and call RunLinkTarget manually.

In all cases, the following is performed:

If the value of pageNumber is 0, then the current page is not changed, otherwise, if the value is not a valid page number, an exception is thrown.

Example

Start with the example created in DocumentViewer, remove all the code in the Example function and add the code below.

When the user clicks the Example button, we will go to page number 3 in the document and set the fit mode to "page width".

JavaScript Example
// Create a new DocumentLink 
// First the target, goto page number 3 and fit width 
var linkTarget = new lt.Documents.DocumentLinkTarget(); 
linkTarget.pageNumber = 3; 
linkTarget.pageFitType = lt.Documents.DocumentPageFitType.fitWidth; 
// Now the link, of type goto-page 
var link = new l.Documents.DocumentLink(); 
link.linkType = lt.Documents.DocumentLinkType.targetPage; 
link.target = linkTarget; 
 
// Run this link 
this._documentViewer.runLinkTarget(linkTarget); 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Documents.UI Assembly