playground/assets/dflip/js/dflip.js
/**
         * @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 (self.pdfViewer.contentProvider.options.pageSize == DFLIP.PAGE_SIZE.DOUBLEINTERNAL && pageNumber > 2) {
                        pageNumber = pageNumber * 2 - 1;
                    }
                    if (pageNumber > self.pdfViewer.pageCount) {
                        pageNumber = self.pdfViewer.pageCount;
                    }
                    self.pdfViewer.gotoPage(pageNumber);
                    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 ( self . pdfViewer . contentProvider . options . pageSize == DFLIP . PAGE_SIZE . DOUBLEINTERNAL && pageNumber > 2 ) { pageNumber = pageNumber * 2 - 1 ; } if ( pageNumber > self . pdfViewer . pageCount ) { pageNumber = self . pdfViewer . pageCount ; } self . pdfViewer . gotoPage ( pageNumber ) ; 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..>
 //case double internal
 // self.pdfViewer.scrollPageIntoView(pageNumber, dest);
 // Update the browsing history.
 // invalid destination
