function PDFLinkService_navigateTo(dest) {
      var destString = '';
      var self = this;

      var goToDestination = function(destRef) {
        // dest array looks like that: <page-ref> </XYZ|FitXXX> <args..>
        var pageNumber = destRef instanceof Object ?
          self._pagesRefCache[destRef.num + ' ' + destRef.gen + ' R'] :
          (destRef + 1);
        if (pageNumber) {
          if (pageNumber > self.pagesCount) {
            pageNumber = self.pagesCount;
          }
          self.pdfViewer.scrollPageIntoView(pageNumber, dest);

          if (self.pdfHistory) {
            // Update the browsing history.
            self.pdfHistory.push({
              dest: dest,
              hash: destString,
              page: pageNumber
            });
          }
        } else {
          self.pdfDocument.getPageIndex(destRef).then(function (pageIndex) {
            var pageNum = pageIndex + 1;
            var cacheKey = destRef.num + ' ' + destRef.gen + ' R';
            self._pagesRefCache[cacheKey] = pageNum;
            goToDestination(destRef);
          });
        }
      };

      var destinationPromise;
      if (typeof dest === 'string') {
        destString = dest;
        destinationPromise = this.pdfDocument.getDestination(dest);
      } else {
        destinationPromise = Promise.resolve(dest);
      }
      destinationPromise.then(function(destination) {
        dest = destination;
        if (!(destination instanceof Array)) {
          return; // invalid destination
        }
        goToDestination(destination[0]);
      });
    }
/**
     * @param dest - The PDF destination object.
     */
@param dest - The PDF destination object.
@param dest - The PDF destination object .
function PDFLinkService_navigateTo(dest) {
      var destString = '';
      var self = this;
      var goToDestination = function(destRef) {
        var pageNumber = destRef instanceof Object ?
          self._pagesRefCache[destRef.num + ' ' + destRef.gen + ' R'] :
          (destRef + 1);
        if (pageNumber) {
          if (pageNumber > self.pagesCount) {
            pageNumber = self.pagesCount;
          }
          self.pdfViewer.scrollPageIntoView(pageNumber, dest);
          if (self.pdfHistory) {
            self.pdfHistory.push({
              dest: dest,
              hash: destString,
              page: pageNumber
            });
          }
        } else {
          self.pdfDocument.getPageIndex(destRef).then(function (pageIndex) {
            var pageNum = pageIndex + 1;
            var cacheKey = destRef.num + ' ' + destRef.gen + ' R';
            self._pagesRefCache[cacheKey] = pageNum;
            goToDestination(destRef);
          });
        }
      };
      var destinationPromise;
      if (typeof dest === 'string') {
        destString = dest;
        destinationPromise = this.pdfDocument.getDestination(dest);
      } else {
        destinationPromise = Promise.resolve(dest);
      }
      destinationPromise.then(function(destination) {
        dest = destination;
        if (!(destination instanceof Array)) {
          return; 
        }
        goToDestination(destination[0]);
      });
    }
function PDFLinkService_navigateTo ( dest ) { var destString = '' ; var self = this ; var goToDestination = function ( destRef ) { var pageNumber = destRef instanceof Object ? self . _pagesRefCache [ destRef . num + ' ' + destRef . gen + ' R' ] : ( destRef + 1 ) ; if ( pageNumber ) { if ( pageNumber > self . pagesCount ) { pageNumber = self . pagesCount ; } self . pdfViewer . scrollPageIntoView ( pageNumber , dest ) ; if ( self . pdfHistory ) { self . pdfHistory . push ( { dest : dest , hash : destString , page : pageNumber } ) ; } } else { self . pdfDocument . getPageIndex ( destRef ) . then ( function ( pageIndex ) { var pageNum = pageIndex + 1 ; var cacheKey = destRef . num + ' ' + destRef . gen + ' R' ; self . _pagesRefCache [ cacheKey ] = pageNum ; goToDestination ( destRef ) ; } ) ; } } ; var destinationPromise ; if ( typeof dest === 'string' ) { destString = dest ; destinationPromise = this . pdfDocument . getDestination ( dest ) ; } else { destinationPromise = Promise . resolve ( dest ) ; } destinationPromise . then ( function ( destination ) { dest = destination ; if ( ! ( destination instanceof Array ) ) { return ; } goToDestination ( destination [ 0 ] ) ; } ) ; }
@param dest - The PDF destination object.
@param dest - The PDF destination object .
// dest array looks like that: <page-ref> </XYZ|FitXXX> <args..> // Update the browsing history. // invalid destination