@ -120,7 +120,7 @@ module.exports = pdfjsLib;
@@ -120,7 +120,7 @@ module.exports = pdfjsLib;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . waitOnEventOrTimeout = exports . WaitOnType = exports . localized = exports . animationStarted = exports . normalizeWheelEventDelta = exports . binarySearchFirstItem = exports . watchScroll = exports . scrollIntoView = exports . getOutputScale = exports . approximateFraction = exports . roundToDivide = exports . getVisibleElements = exports . parseQueryString = exports . noContextMenuHandler = exports . getPDFFileNameFromURL = exports . ProgressBar = exports . EventBus = exports . NullL10n = exports . mozL10n = exports . RendererType = exports . PresentationModeState = exports . cloneObj = exports . isFileSchema = exports . isValidRotation = exports . VERTICAL _PADDING = exports . SCROLLBAR _PADDING = exports . MAX _AUTO _SCALE = exports . UNKNOWN _SCALE = exports . MAX _SCALE = exports . MIN _SCALE = exports . DEFAULT _SCALE = exports . DEFAULT _SCALE _VALUE = exports . CSS _UNITS = undefined ;
exports . waitOnEventOrTimeout = exports . WaitOnType = exports . localized = exports . animationStarted = exports . normalizeWheelEventDelta = exports . binarySearchFirstItem = exports . watchScroll = exports . scrollIntoView = exports . getOutputScale = exports . approximateFraction = exports . roundToDivide = exports . getVisibleElements = exports . parseQueryString = exports . noContextMenuHandler = exports . getPDFFileNameFromURL = exports . ProgressBar = exports . EventBus = exports . NullL10n = exports . mozL10n = exports . TextLayerMode = exports . RendererType = exports . PresentationModeState = exports . cloneObj = exports . isFileSchema = exports . isValidRotation = exports . VERTICAL _PADDING = exports . SCROLLBAR _PADDING = exports . MAX _AUTO _SCALE = exports . UNKNOWN _SCALE = exports . MAX _SCALE = exports . MIN _SCALE = exports . DEFAULT _SCALE = exports . DEFAULT _SCALE _VALUE = exports . CSS _UNITS = undefined ;
var _createClass = function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ( ) ;
@ -149,6 +149,11 @@ var RendererType = {
@@ -149,6 +149,11 @@ var RendererType = {
CANVAS : 'canvas' ,
SVG : 'svg'
} ;
var TextLayerMode = {
DISABLE : 0 ,
ENABLE : 1 ,
ENABLE _ENHANCE : 2
} ;
function formatL10nValue ( text , args ) {
if ( ! args ) {
return text ;
@ -168,13 +173,11 @@ var NullL10n = {
@@ -168,13 +173,11 @@ var NullL10n = {
return Promise . resolve ( ) ;
}
} ;
_pdfjsLib . PDFJS . disableFullscreen = _pdfjsLib . PDFJS . disableFullscreen === undefined ? false : _pdfjsLib . PDFJS . disableFullscreen ;
_pdfjsLib . PDFJS . useOnlyCssZoom = _pdfjsLib . PDFJS . useOnlyCssZoom === undefined ? false : _pdfjsLib . PDFJS . useOnlyCssZoom ;
_pdfjsLib . PDFJS . maxCanvasPixels = _pdfjsLib . PDFJS . maxCanvasPixels === undefined ? 16777216 : _pdfjsLib . PDFJS . maxCanvasPixels ;
_pdfjsLib . PDFJS . disableHistory = _pdfjsLib . PDFJS . disableHistory === undefined ? false : _pdfjsLib . PDFJS . disableHistory ;
_pdfjsLib . PDFJS . disableTextLayer = _pdfjsLib . PDFJS . disableTextLayer === undefined ? false : _pdfjsLib . PDFJS . disableTextLayer ;
{
_pdfjsLib . PDFJS . locale = _pdfjsLib . PDFJS . locale === undefined && typeof navigator !== 'undefined' ? navigator . language : _pdfjsLib . PDFJS . locale ;
_pdfjsLib . PDFJS . locale = ( _pdfjsLib . PDFJS . locale === undefined && typeof navigator !== 'undefined' ? navigator . language : _pdfjsLib . PDFJS . locale ) || 'en-US' ;
}
function getOutputScale ( ctx ) {
var devicePixelRatio = window . devicePixelRatio || 1 ;
@ -629,6 +632,7 @@ exports.isFileSchema = isFileSchema;
@@ -629,6 +632,7 @@ exports.isFileSchema = isFileSchema;
exports . cloneObj = cloneObj ;
exports . PresentationModeState = PresentationModeState ;
exports . RendererType = RendererType ;
exports . TextLayerMode = TextLayerMode ;
exports . mozL10n = mozL10n ;
exports . NullL10n = NullL10n ;
exports . EventBus = EventBus ;
@ -796,11 +800,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
@@ -796,11 +800,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var PDFLinkService = function ( ) {
function PDFLinkService ( ) {
var _ref = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ,
eventBus = _ref . eventBus ;
eventBus = _ref . eventBus ,
_ref$externalLinkTarg = _ref . externalLinkTarget ,
externalLinkTarget = _ref$externalLinkTarg === undefined ? null : _ref$externalLinkTarg ,
_ref$externalLinkRel = _ref . externalLinkRel ,
externalLinkRel = _ref$externalLinkRel === undefined ? null : _ref$externalLinkRel ;
_classCallCheck ( this , PDFLinkService ) ;
this . eventBus = eventBus || ( 0 , _dom _events . getGlobalEventBus ) ( ) ;
this . externalLinkTarget = externalLinkTarget ;
this . externalLinkRel = externalLinkRel ;
this . baseUrl = null ;
this . pdfDocument = null ;
this . pdfViewer = null ;
@ -1130,6 +1140,9 @@ function isValidExplicitDestination(dest) {
@@ -1130,6 +1140,9 @@ function isValidExplicitDestination(dest) {
var SimpleLinkService = function ( ) {
function SimpleLinkService ( ) {
_classCallCheck ( this , SimpleLinkService ) ;
this . externalLinkTarget = null ;
this . externalLinkRel = null ;
}
_createClass ( SimpleLinkService , [ {
@ -1209,6 +1222,8 @@ var AnnotationLayerBuilder = function () {
@@ -1209,6 +1222,8 @@ var AnnotationLayerBuilder = function () {
pdfPage = _ref . pdfPage ,
linkService = _ref . linkService ,
downloadManager = _ref . downloadManager ,
_ref$imageResourcesPa = _ref . imageResourcesPath ,
imageResourcesPath = _ref$imageResourcesPa === undefined ? '' : _ref$imageResourcesPa ,
_ref$renderInteractiv = _ref . renderInteractiveForms ,
renderInteractiveForms = _ref$renderInteractiv === undefined ? false : _ref$renderInteractiv ,
_ref$l10n = _ref . l10n ,
@ -1220,6 +1235,7 @@ var AnnotationLayerBuilder = function () {
@@ -1220,6 +1235,7 @@ var AnnotationLayerBuilder = function () {
this . pdfPage = pdfPage ;
this . linkService = linkService ;
this . downloadManager = downloadManager ;
this . imageResourcesPath = imageResourcesPath ;
this . renderInteractiveForms = renderInteractiveForms ;
this . l10n = l10n ;
this . div = null ;
@ -1242,6 +1258,7 @@ var AnnotationLayerBuilder = function () {
@@ -1242,6 +1258,7 @@ var AnnotationLayerBuilder = function () {
div : _this . div ,
annotations : annotations ,
page : _this . pdfPage ,
imageResourcesPath : _this . imageResourcesPath ,
renderInteractiveForms : _this . renderInteractiveForms ,
linkService : _this . linkService ,
downloadManager : _this . downloadManager
@ -1287,12 +1304,14 @@ var DefaultAnnotationLayerFactory = function () {
@@ -1287,12 +1304,14 @@ var DefaultAnnotationLayerFactory = function () {
_createClass ( DefaultAnnotationLayerFactory , [ {
key : 'createAnnotationLayerBuilder' ,
value : function createAnnotationLayerBuilder ( pageDiv , pdfPage ) {
var renderInteractiveForms = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : false ;
var l10n = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : _ui _utils . NullL10n ;
var imageResourcesPath = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : '' ;
var renderInteractiveForms = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : false ;
var l10n = arguments . length > 4 && arguments [ 4 ] !== undefined ? arguments [ 4 ] : _ui _utils . NullL10n ;
return new AnnotationLayerBuilder ( {
pageDiv : pageDiv ,
pdfPage : pdfPage ,
imageResourcesPath : imageResourcesPath ,
renderInteractiveForms : renderInteractiveForms ,
linkService : new _pdf _link _service . SimpleLinkService ( ) ,
l10n : l10n
@ -1672,8 +1691,12 @@ var _dom_events = __w_pdfjs_require__(2);
@@ -1672,8 +1691,12 @@ var _dom_events = __w_pdfjs_require__(2);
var _pdf _rendering _queue = _ _w _pdfjs _require _ _ ( 7 ) ;
var _viewer _compatibility = _ _w _pdfjs _require _ _ ( 15 ) ;
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
var MAX _CANVAS _PIXELS = _viewer _compatibility . viewerCompatibilityParams . maxCanvasPixels || 16777216 ;
var PDFPageView = function ( ) {
function PDFPageView ( options ) {
_classCallCheck ( this , PDFPageView ) ;
@ -1689,13 +1712,17 @@ var PDFPageView = function () {
@@ -1689,13 +1712,17 @@ var PDFPageView = function () {
this . viewport = defaultViewport ;
this . pdfPageRotate = defaultViewport . rotation ;
this . hasRestrictedScaling = false ;
this . enhanceTextSelection = options . enhanceTextSelection || false ;
this . textLayerMode = Number . isInteger ( options . textLayerMode ) ? options . textLayerMode : _ui _utils . TextLayerMode . ENABLE ;
this . imageResourcesPath = options . imageResourcesPath || '' ;
this . renderInteractiveForms = options . renderInteractiveForms || false ;
this . useOnlyCssZoom = options . useOnlyCssZoom || false ;
this . maxCanvasPixels = options . maxCanvasPixels || MAX _CANVAS _PIXELS ;
this . eventBus = options . eventBus || ( 0 , _dom _events . getGlobalEventBus ) ( ) ;
this . renderingQueue = options . renderingQueue ;
this . textLayerFactory = options . textLayerFactory ;
this . annotationLayerFactory = options . annotationLayerFactory ;
this . renderer = options . renderer || _ui _utils . RendererType . CANVAS ;
this . enableWebGL = options . enableWebGL || false ;
this . l10n = options . l10n || _ui _utils . NullL10n ;
this . paintTask = null ;
this . paintedViewportMap = new WeakMap ( ) ;
@ -1817,14 +1844,14 @@ var PDFPageView = function () {
@@ -1817,14 +1844,14 @@ var PDFPageView = function () {
return ;
}
var isScalingRestricted = false ;
if ( this . canvas && _pdfjsLib . PDFJS . maxCanvasPixels > 0 ) {
if ( this . canvas && this . maxCanvasPixels > 0 ) {
var outputScale = this . outputScale ;
if ( ( Math . floor ( this . viewport . width ) * outputScale . sx | 0 ) * ( Math . floor ( this . viewport . height ) * outputScale . sy | 0 ) > _pdfjsLib . PDFJS . maxCanvasPixels ) {
if ( ( Math . floor ( this . viewport . width ) * outputScale . sx | 0 ) * ( Math . floor ( this . viewport . height ) * outputScale . sy | 0 ) > this . maxCanvasPixels ) {
isScalingRestricted = true ;
}
}
if ( this . canvas ) {
if ( _pdfjsLib . PDFJS . useOnlyCssZoom || this . hasRestrictedScaling && isScalingRestricted ) {
if ( this . useOnlyCssZoom || this . hasRestrictedScaling && isScalingRestricted ) {
this . cssTransform ( this . canvas , true ) ;
this . eventBus . dispatch ( 'pagerendered' , {
source : this ,
@ -1952,7 +1979,7 @@ var PDFPageView = function () {
@@ -1952,7 +1979,7 @@ var PDFPageView = function () {
div . appendChild ( canvasWrapper ) ;
}
var textLayer = null ;
if ( this . textLayerFactory ) {
if ( this . textLayerMode !== _ui _utils . TextLayerMode . DISABLE && this . textLayer Factory ) {
var textLayerDiv = document . createElement ( 'div' ) ;
textLayerDiv . className = 'textLayer' ;
textLayerDiv . style . width = canvasWrapper . style . width ;
@ -1962,7 +1989,7 @@ var PDFPageView = function () {
@@ -1962,7 +1989,7 @@ var PDFPageView = function () {
} else {
div . appendChild ( textLayerDiv ) ;
}
textLayer = this . textLayerFactory . createTextLayerBuilder ( textLayerDiv , this . id - 1 , this . viewport , this . enhanceTextSelection ) ;
textLayer = this . textLayerFactory . createTextLayerBuilder ( textLayerDiv , this . id - 1 , this . viewport , this . textLayerMode === _ui _utils . TextLayerMode . ENABLE _ENHANCE ) ;
}
this . textLayer = textLayer ;
var renderContinueCallback = null ;
@ -2024,7 +2051,7 @@ var PDFPageView = function () {
@@ -2024,7 +2051,7 @@ var PDFPageView = function () {
} ) ;
if ( this . annotationLayerFactory ) {
if ( ! this . annotationLayer ) {
this . annotationLayer = this . annotationLayerFactory . createAnnotationLayerBuilder ( div , pdfPage , this . renderInteractiveForms , this . l10n ) ;
this . annotationLayer = this . annotationLayerFactory . createAnnotationLayerBuilder ( div , pdfPage , this . imageResourcesPath , this . renderInteractiveForms , this . l10n ) ;
}
this . annotationLayer . render ( this . viewport , 'display' ) ;
}
@ -2064,15 +2091,15 @@ var PDFPageView = function () {
@@ -2064,15 +2091,15 @@ var PDFPageView = function () {
var ctx = canvas . getContext ( '2d' , { alpha : false } ) ;
var outputScale = ( 0 , _ui _utils . getOutputScale ) ( ctx ) ;
this . outputScale = outputScale ;
if ( _pdfjsLib . PDFJS . useOnlyCssZoom ) {
if ( this . useOnlyCssZoom ) {
var actualSizeViewport = viewport . clone ( { scale : _ui _utils . CSS _UNITS } ) ;
outputScale . sx *= actualSizeViewport . width / viewport . width ;
outputScale . sy *= actualSizeViewport . height / viewport . height ;
outputScale . scaled = true ;
}
if ( _pdfjsLib . PDFJS . maxCanvasPixels > 0 ) {
if ( this . maxCanvasPixels > 0 ) {
var pixelsInViewport = viewport . width * viewport . height ;
var maxScale = Math . sqrt ( _pdfjsLib . PDFJS . maxCanvasPixels / pixelsInViewport ) ;
var maxScale = Math . sqrt ( this . maxCanvasPixels / pixelsInViewport ) ;
if ( outputScale . sx > maxScale || outputScale . sy > maxScale ) {
outputScale . sx = maxScale ;
outputScale . sy = maxScale ;
@ -2094,6 +2121,7 @@ var PDFPageView = function () {
@@ -2094,6 +2121,7 @@ var PDFPageView = function () {
canvasContext : ctx ,
transform : transform ,
viewport : this . viewport ,
enableWebGL : this . enableWebGL ,
renderInteractiveForms : this . renderInteractiveForms
} ;
var renderTask = this . pdfPage . render ( renderContext ) ;
@ -2394,10 +2422,15 @@ var BaseViewer = function () {
@@ -2394,10 +2422,15 @@ var BaseViewer = function () {
this . linkService = options . linkService || new _pdf _link _service . SimpleLinkService ( ) ;
this . downloadManager = options . downloadManager || null ;
this . removePageBorders = options . removePageBorders || false ;
this . textLayerMode = Number . isInteger ( options . textLayerMode ) ? options . textLayerMode : _ui _utils . TextLayerMode . ENABLE ;
this . enhanceTextSelection = options . enhanceTextSelection || false ;
this . imageResourcesPath = options . imageResourcesPath || '' ;
this . renderInteractiveForms = options . renderInteractiveForms || false ;
this . enablePrintAutoRotate = options . enablePrintAutoRotate || false ;
this . renderer = options . renderer || _ui _utils . RendererType . CANVAS ;
this . enableWebGL = options . enableWebGL || false ;
this . useOnlyCssZoom = options . useOnlyCssZoom || false ;
this . maxCanvasPixels = options . maxCanvasPixels ;
this . l10n = options . l10n || _ui _utils . NullL10n ;
this . defaultRenderingQueue = ! options . renderingQueue ;
if ( this . defaultRenderingQueue ) {
@ -2490,7 +2523,7 @@ var BaseViewer = function () {
@@ -2490,7 +2523,7 @@ var BaseViewer = function () {
var viewport = pdfPage . getViewport ( scale * _ui _utils . CSS _UNITS ) ;
for ( var pageNum = 1 ; pageNum <= pagesCount ; ++ pageNum ) {
var textLayerFactory = null ;
if ( ! _pdfjsLib . PDFJS . disableTextLayer ) {
if ( _this . textLayerMode !== _ui _utils . TextLayerMode . DISABLE ) {
textLayerFactory = _this ;
}
var pageView = new _pdf _page _view . PDFPageView ( {
@ -2501,10 +2534,14 @@ var BaseViewer = function () {
@@ -2501,10 +2534,14 @@ var BaseViewer = function () {
defaultViewport : viewport . clone ( ) ,
renderingQueue : _this . renderingQueue ,
textLayerFactory : textLayerFactory ,
textLayerMode : _this . textLayerMode ,
annotationLayerFactory : _this ,
enhanceTextSelection : _this . enhanceTextSelection ,
imageResourcesPath : _this . imageResourcesPath ,
renderInteractiveForms : _this . renderInteractiveForms ,
renderer : _this . renderer ,
enableWebGL : _this . enableWebGL ,
useOnlyCssZoom : _this . useOnlyCssZoom ,
maxCanvasPixels : _this . maxCanvasPixels ,
l10n : _this . l10n
} ) ;
bindOnAfterAndBeforeDraw ( pageView ) ;
@ -2934,12 +2971,14 @@ var BaseViewer = function () {
@@ -2934,12 +2971,14 @@ var BaseViewer = function () {
} , {
key : 'createAnnotationLayerBuilder' ,
value : function createAnnotationLayerBuilder ( pageDiv , pdfPage ) {
var renderInteractiveForms = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : false ;
var l10n = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : _ui _utils . NullL10n ;
var imageResourcesPath = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : '' ;
var renderInteractiveForms = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : false ;
var l10n = arguments . length > 4 && arguments [ 4 ] !== undefined ? arguments [ 4 ] : _ui _utils . NullL10n ;
return new _annotation _layer _builder . AnnotationLayerBuilder ( {
pageDiv : pageDiv ,
pdfPage : pdfPage ,
imageResourcesPath : imageResourcesPath ,
renderInteractiveForms : renderInteractiveForms ,
linkService : this . linkService ,
downloadManager : this . downloadManager ,
@ -3147,9 +3186,9 @@ var _pdfjs2 = _interopRequireDefault(_pdfjs);
@@ -3147,9 +3186,9 @@ var _pdfjs2 = _interopRequireDefault(_pdfjs);
var _pdf _page _view = _ _w _pdfjs _require _ _ ( 6 ) ;
var _pdf _single _page _viewer = _ _w _pdfjs _require _ _ ( 15 ) ;
var _pdf _single _page _viewer = _ _w _pdfjs _require _ _ ( 16 ) ;
var _pdf _viewer = _ _w _pdfjs _require _ _ ( 16 ) ;
var _pdf _viewer = _ _w _pdfjs _require _ _ ( 17 ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
@ -4940,6 +4979,36 @@ exports.isDestArraysEqual = isDestArraysEqual;
@@ -4940,6 +4979,36 @@ exports.isDestArraysEqual = isDestArraysEqual;
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var compatibilityParams = Object . create ( null ) ;
{
var userAgent = typeof navigator !== 'undefined' && navigator . userAgent || '' ;
var isAndroid = /Android/ . test ( userAgent ) ;
var isIE = /Trident/ . test ( userAgent ) ;
var isIOS = /\b(iPad|iPhone|iPod)(?=;)/ . test ( userAgent ) ;
( function checkFullscreenSupport ( ) {
if ( isIE && window . parent !== window ) {
compatibilityParams . disableFullscreen = true ;
}
} ) ( ) ;
( function checkCanvasSizeLimitation ( ) {
if ( isIOS || isAndroid ) {
compatibilityParams . maxCanvasPixels = 5242880 ;
}
} ) ( ) ;
}
var viewerCompatibilityParams = Object . freeze ( compatibilityParams ) ;
exports . viewerCompatibilityParams = viewerCompatibilityParams ;
/***/ } ) ,
/* 16 */
/***/ ( function ( module , exports , _ _w _pdfjs _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
@ -5097,7 +5166,7 @@ var PDFSinglePageViewer = function (_BaseViewer) {
@@ -5097,7 +5166,7 @@ var PDFSinglePageViewer = function (_BaseViewer) {
exports . PDFSinglePageViewer = PDFSinglePageViewer ;
/***/ } ) ,
/* 16 */
/* 17 */
/***/ ( function ( module , exports , _ _w _pdfjs _require _ _ ) {
"use strict" ;