diff --git a/build/app/app.component.js b/build/app/app.component.js index 09c20c451..6a901dd76 100644 --- a/build/app/app.component.js +++ b/build/app/app.component.js @@ -16,7 +16,7 @@ var AppComponent = (function () { this.fitToPage = false; } AppComponent.prototype.setCustomWorkerPath = function () { - PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js'; + window.PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js'; }; AppComponent.prototype.incrementPage = function (amount) { this.page += amount; diff --git a/build/app/app.component.js.map b/build/app/app.component.js.map index 6312232a0..1c8218b24 100644 --- a/build/app/app.component.js.map +++ b/build/app/app.component.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/app/app.component.ts"],"names":[],"mappings":";;AAGA,sCAA0C;AAK1C;IA2BE;QAzBA,WAAM,GAAW,gBAAgB,CAAC;QAYlC,SAAI,GAAW,CAAC,CAAC;QACjB,aAAQ,GAAW,CAAC,CAAC;QACrB,SAAI,GAAW,GAAG,CAAC;QACnB,iBAAY,GAAY,KAAK,CAAC;QAE9B,eAAU,GAAY,IAAI,CAAC;QAE3B,aAAQ,GAAY,KAAK,CAAC;QAC1B,gBAAW,GAAG,KAAK,CAAC;QACpB,YAAO,GAAY,IAAI,CAAC;QACxB,eAAU,GAAY,IAAI,CAAC;QAC3B,cAAS,GAAY,KAAK,CAAC;IAiB3B,CAAC;IAKD,0CAAmB,GAAnB;QACE,KAAK,CAAC,SAAS,GAAG,qCAAqC,CAAC;IAC1D,CAAC;IAED,oCAAa,GAAb,UAAc,MAAc;QAC1B,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC;IACtB,CAAC;IAED,oCAAa,GAAb,UAAc,MAAc;QAC1B,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC;IACtB,CAAC;IAED,6BAAM,GAAN,UAAO,KAAa;QAClB,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;IACzB,CAAC;IAKD,qCAAc,GAAd;QAAA,iBAYC;QAXC,IAAI,IAAI,GAAQ,QA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F,CAC7F,CAAC;IACF,mBAAC;CA3HD,AA2HC,IAAA;AA3HY,oCAAY","file":"app.component.js","sourceRoot":"","sourcesContent":["/**\n * Created by vadimdez on 21/06/16.\n */\nimport { Component } from '@angular/core';\nimport { PDFProgressData, PDFDocumentProxy } from 'pdfjs-dist';\n\n\n\nexport class AppComponent {\n\n pdfSrc: string = './pdf-test.pdf';\n\n // or pass options as object\n // pdfSrc: any = {\n // url: './pdf-test.pdf',\n // withCredentials: true,\n //// httpHeaders: { // cross domain\n //// 'Access-Control-Allow-Credentials': true\n //// }\n // };\n\n error: any;\n page: number = 1;\n rotation: number = 0;\n zoom: number = 1.0;\n originalSize: boolean = false;\n pdf: any;\n renderText: boolean = true;\n progressData: PDFProgressData;\n isLoaded: boolean = false;\n stickToPage = false;\n showAll: boolean = true;\n autoresize: boolean = true;\n fitToPage: boolean = false;\n\n constructor() {\n // Load pdf\n // let xhr = new XMLHttpRequest();\n // xhr.open('GET', 'http://localhost:8000/pdf-test.pdf', true);\n // xhr.responseType = 'blob';\n //\n // xhr.onload = (e: any) => {\n // console.log(xhr);\n // if (xhr.status === 200) {\n // let blob = new Blob([xhr.response], {type: 'application/pdf'});\n // this.pdfSrc = URL.createObjectURL(blob);\n // }\n // };\n //\n // xhr.send();\n }\n\n /**\n * Set custom path to pdf worker\n */\n setCustomWorkerPath() {\n PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js';\n }\n\n incrementPage(amount: number) {\n this.page += amount;\n }\n\n incrementZoom(amount: number) {\n this.zoom += amount;\n }\n\n rotate(angle: number) {\n this.rotation += angle;\n }\n\n /**\n * Render PDF preview on selecting file\n */\n onFileSelected() {\n let $img: any = document.querySelector('#file');\n\n if (typeof (FileReader) !== 'undefined') {\n let reader = new FileReader();\n\n reader.onload = (e: any) => {\n this.pdfSrc = e.target.result;\n };\n\n reader.readAsArrayBuffer($img.files[0]);\n }\n }\n\n /**\n * Get pdf information after it's loaded\n * @param pdf\n */\n afterLoadComplete(pdf: PDFDocumentProxy) {\n this.pdf = pdf;\n this.isLoaded = true;\n }\n\n /**\n * Handle error callback\n *\n * @param error\n */\n onError(error: any) {\n this.error = error; // set error\n }\n\n /**\n * Pdf loading progress callback\n * @param {PDFProgressData} progressData\n */\n onProgress(progressData: PDFProgressData) {\n console.log(progressData);\n this.progressData = progressData;\n this.isLoaded = false;\n this.error = null; // clear error\n }\n\n getInt(value: number): number {\n return Math.round(value);\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n moduleId: module.id,\n selector: 'pdf-viewer-app',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../src/app/app.component.ts"],"names":[],"mappings":";;AAGA,sCAA0C;AAK1C;IA2BE;QAzBA,WAAM,GAAW,gBAAgB,CAAC;QAYlC,SAAI,GAAW,CAAC,CAAC;QACjB,aAAQ,GAAW,CAAC,CAAC;QACrB,SAAI,GAAW,GAAG,CAAC;QACnB,iBAAY,GAAY,KAAK,CAAC;QAE9B,eAAU,GAAY,IAAI,CAAC;QAE3B,aAAQ,GAAY,KAAK,CAAC;QAC1B,gBAAW,GAAG,KAAK,CAAC;QACpB,YAAO,GAAY,IAAI,CAAC;QACxB,eAAU,GAAY,IAAI,CAAC;QAC3B,cAAS,GAAY,KAAK,CAAC;IAiB3B,CAAC;IAKD,0CAAmB,GAAnB;QACQ,MAAO,CAAC,KAAK,CAAC,SAAS,GAAG,qCAAqC,CAAC;IACxE,CAAC;IAED,oCAAa,GAAb,UAAc,MAAc;QAC1B,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC;IACtB,CAAC;IAED,oCAAa,GAAb,UAAc,MAAc;QAC1B,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC;IACtB,CAAC;IAED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BAC1B,WAAW,EAAE,sBAAsB;oBACnC,SAAS,EAAE,CAAC,qBAAqB,CAAC;iBACnC,EAAG,EAAE;KACL,CAAC;IAEK,2BAAc,GAAmE,cAAM,OAAA,EAC7F,EAD6F,CAC7F,CAAC;IACF,mBAAC;CA3HD,AA2HC,IAAA;AA3HY,oCAAY","file":"app.component.js","sourceRoot":"","sourcesContent":["/**\n * Created by vadimdez on 21/06/16.\n */\nimport { Component } from '@angular/core';\nimport { PDFProgressData, PDFDocumentProxy } from 'pdfjs-dist';\n\n\n\nexport class AppComponent {\n\n pdfSrc: string = './pdf-test.pdf';\n\n // or pass options as object\n // pdfSrc: any = {\n // url: './pdf-test.pdf',\n // withCredentials: true,\n //// httpHeaders: { // cross domain\n //// 'Access-Control-Allow-Credentials': true\n //// }\n // };\n\n error: any;\n page: number = 1;\n rotation: number = 0;\n zoom: number = 1.0;\n originalSize: boolean = false;\n pdf: any;\n renderText: boolean = true;\n progressData: PDFProgressData;\n isLoaded: boolean = false;\n stickToPage = false;\n showAll: boolean = true;\n autoresize: boolean = true;\n fitToPage: boolean = false;\n\n constructor() {\n // Load pdf\n // let xhr = new XMLHttpRequest();\n // xhr.open('GET', 'http://localhost:8000/pdf-test.pdf', true);\n // xhr.responseType = 'blob';\n //\n // xhr.onload = (e: any) => {\n // console.log(xhr);\n // if (xhr.status === 200) {\n // let blob = new Blob([xhr.response], {type: 'application/pdf'});\n // this.pdfSrc = URL.createObjectURL(blob);\n // }\n // };\n //\n // xhr.send();\n }\n\n /**\n * Set custom path to pdf worker\n */\n setCustomWorkerPath() {\n (window).PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js';\n }\n\n incrementPage(amount: number) {\n this.page += amount;\n }\n\n incrementZoom(amount: number) {\n this.zoom += amount;\n }\n\n rotate(angle: number) {\n this.rotation += angle;\n }\n\n /**\n * Render PDF preview on selecting file\n */\n onFileSelected() {\n let $img: any = document.querySelector('#file');\n\n if (typeof (FileReader) !== 'undefined') {\n let reader = new FileReader();\n\n reader.onload = (e: any) => {\n this.pdfSrc = e.target.result;\n };\n\n reader.readAsArrayBuffer($img.files[0]);\n }\n }\n\n /**\n * Get pdf information after it's loaded\n * @param pdf\n */\n afterLoadComplete(pdf: PDFDocumentProxy) {\n this.pdf = pdf;\n this.isLoaded = true;\n }\n\n /**\n * Handle error callback\n *\n * @param error\n */\n onError(error: any) {\n this.error = error; // set error\n }\n\n /**\n * Pdf loading progress callback\n * @param {PDFProgressData} progressData\n */\n onProgress(progressData: PDFProgressData) {\n console.log(progressData);\n this.progressData = progressData;\n this.isLoaded = false;\n this.error = null; // clear error\n }\n\n getInt(value: number): number {\n return Math.round(value);\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n moduleId: module.id,\n selector: 'pdf-viewer-app',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]} \ No newline at end of file diff --git a/build/pdf-viewer/index.js.map b/build/pdf-viewer/index.js.map index fd96b09ca..ee3f85d65 100644 --- a/build/pdf-viewer/index.js.map +++ b/build/pdf-viewer/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/pdf-viewer/index.ts"],"names":[],"mappings":";;AAGA,sCAAyC;AAEzC,+DAA4D;AAG5D;IAAA;IAUA,CAAC;IATM,0BAAU,GAA0B;QAC3C,EAAE,IAAI,EAAE,eAAQ,EAAE,IAAI,EAAE,CAAC;oBACvB,YAAY,EAAE,CAAC,yCAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,yCAAkB,CAAC;iBAC9B,EAAG,EAAE;KACL,CAAC;IAEK,8BAAc,GAAmE,cAAM,OAAA,EAC7F,EAD6F,CAC7F,CAAC;IACF,sBAAC;CAVD,AAUC,IAAA;AAVY,0CAAe","file":"index.js","sourceRoot":"","sourcesContent":["/**\n * Created by vadimdez on 01/11/2016.\n */\nimport { NgModule } from '@angular/core';\n\nimport { PdfViewerComponent } from './pdf-viewer.component';\n\n\nexport class PdfViewerModule {\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n declarations: [PdfViewerComponent],\n exports: [PdfViewerComponent]\n}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../src/pdf-viewer/index.ts"],"names":[],"mappings":";;AAGA,sCAAyC;AAEzC,+DAA4D;AAU5D;IAAA;IAUA,CAAC;IATM,0BAAU,GAA0B;QAC3C,EAAE,IAAI,EAAE,eAAQ,EAAE,IAAI,EAAE,CAAC;oBACvB,YAAY,EAAE,CAAC,yCAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,yCAAkB,CAAC;iBAC9B,EAAG,EAAE;KACL,CAAC;IAEK,8BAAc,GAAmE,cAAM,OAAA,EAC7F,EAD6F,CAC7F,CAAC;IACF,sBAAC;CAVD,AAUC,IAAA;AAVY,0CAAe","file":"index.js","sourceRoot":"","sourcesContent":["/**\n * Created by vadimdez on 01/11/2016.\n */\nimport { NgModule } from '@angular/core';\n\nimport { PdfViewerComponent } from './pdf-viewer.component';\nimport { PDFJSStatic } from \"pdfjs-dist\";\n\ndeclare global {\n const PDFJS: PDFJSStatic;\n}\n\nexport { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';\n\n\nexport class PdfViewerModule {\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n declarations: [PdfViewerComponent],\n exports: [PdfViewerComponent]\n}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]} \ No newline at end of file diff --git a/build/pdf-viewer/pdf-viewer.component.d.ts b/build/pdf-viewer/pdf-viewer.component.d.ts index c61ec4165..e57a8d210 100644 --- a/build/pdf-viewer/pdf-viewer.component.d.ts +++ b/build/pdf-viewer/pdf-viewer.component.d.ts @@ -1,9 +1,6 @@ /// import { ElementRef, EventEmitter, OnChanges, SimpleChanges, OnInit } from '@angular/core'; -import { PDFJSStatic, PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist'; -declare global { - const PDFJS: PDFJSStatic; -} +import { PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist'; export declare class PdfViewerComponent implements OnChanges, OnInit { private element; static CSS_UNITS: number; diff --git a/build/pdf-viewer/pdf-viewer.component.js.map b/build/pdf-viewer/pdf-viewer.component.js.map index e0d0a78d6..1efa50371 100644 --- a/build/pdf-viewer/pdf-viewer.component.js.map +++ b/build/pdf-viewer/pdf-viewer.component.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/pdf-viewer/pdf-viewer.component.ts"],"names":[],"mappings":";;AAGA,sCAEuB;AAOvB;IACE,MAAM,CAAC,OAAO,MAAA,KAAW,WAAA,CAAY;AACvC,CAAC;AAED,EAAE,CAAC,CAAC,CAAC,KAAC,EAAK,CAAE,CAAC,CAAA;IACZ,MAAM,CAAC,sBAAC,CAAsB,GAAG,OAAA,CAAQ,sBAAC,CAAsB,CAAC;IACjE,OAAO,CAAC,8BAAC,CAA8B,CAAC;IACxC,OAAO,CAAC,2BAAC,CAA2B,CAAC;IAErC,KAAK,CAAC,SAAC,GAAiB,KAAM,CAAC,gBAAC,CAAgB,MAAC,CAAM;AACzD,CAAC;AAKD;IAuBE,4BAAoB,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;QApB/B,gBAAW,GAAY,IAAI,CAAC;QAC5B,iBAAY,GAAY,KAAK,CAAC;QAC9B,kBAAa,GAAY,IAAI,CAAC;QAE9B,UAAK,GAAW,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file":"pdf-viewer.component.js","sourceRoot":"","sourcesContent":["/**\n * Created by vadimdez on 21/06/16.\n */\nimport {\n Component, Input, Output, ElementRef, EventEmitter, OnChanges, SimpleChanges, OnInit, HostListener\n} from '@angular/core';\nimport { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';\n\ndeclare global {\n const PDFJS: PDFJSStatic;\n}\n\nfunction isSSR() {\n return typeof window === 'undefined';\n}\n\nif (!isSSR()) {\n window['pdfjs-dist/build/pdf'] = require('pdfjs-dist/build/pdf');\n require('pdfjs-dist/web/compatibility');\n require('pdfjs-dist/web/pdf_viewer');\n\n PDFJS.verbosity = (PDFJS).VERBOSITY_LEVELS.errors;\n}\n\n\n\n\nexport class PdfViewerComponent implements OnChanges, OnInit {\n static CSS_UNITS: number = 96.0 / 72.0;\n\n private _renderText: boolean = true;\n private _stickToPage: boolean = false;\n private _originalSize: boolean = true;\n private _pdf: PDFDocumentProxy;\n private _page: number = 1;\n private _zoom: number = 1;\n private _rotation: number = 0;\n private _showAll: boolean = true;\n private _canAutoResize: boolean = true;\n private _fitToPage: boolean = false;\n private _externalLinkTarget: string = 'blank';\n private _pdfViewer: any;\n private _pdfLinkService: any;\n private lastLoaded: string | Uint8Array | PDFSource;\n private resizeTimeout: NodeJS.Timer;\n\n afterLoadComplete = new EventEmitter();\n onError = new EventEmitter();\n onProgress = new EventEmitter();\n\n constructor(private element: ElementRef) {\n if (!isSSR() && typeof PDFJS.workerSrc !== 'string') {\n PDFJS.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${ (PDFJS as any).version }/pdf.worker.min.js`;\n }\n }\n\n ngOnInit() {\n if (!isSSR()) {\n this.setupViewer();\n }\n }\n\n \n public onPageResize() {\n if (!this._canAutoResize) {\n return;\n }\n\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n }\n\n this.resizeTimeout = setTimeout(() => {\n this.updateSize();\n }, 100);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (isSSR()) {\n return;\n }\n\n if ('src' in changes) {\n this.loadPDF();\n } else if (this._pdf) {\n if ('renderText' in changes) {\n this.setupViewer();\n }\n this.update();\n }\n }\n\n \n src: string | Uint8Array | PDFSource;\n\n \n set page(_page) {\n _page = parseInt(_page, 10);\n\n if (this._pdf && !this.isValidPageNumber(_page)) {\n _page = 1;\n }\n\n this._page = _page;\n this.pageChange.emit(_page);\n }\n\n pageChange: EventEmitter = new EventEmitter(true);\n\n \n set renderText(renderText: boolean) {\n this._renderText = renderText;\n }\n\n \n set originalSize(originalSize: boolean) {\n this._originalSize = originalSize;\n }\n\n \n set showAll(value: boolean) {\n this._showAll = value;\n }\n\n \n set stickToPage(value: boolean) {\n this._stickToPage = value;\n }\n\n \n set zoom(value: number) {\n if (value <= 0) {\n return;\n }\n\n this._zoom = value;\n }\n\n get zoom() {\n return this._zoom;\n }\n\n \n set rotation(value: number) {\n if (!(typeof value === 'number' && value % 90 === 0)) {\n console.warn('Invalid pages rotation angle.');\n return;\n }\n\n this._rotation = value;\n }\n\n \n set externalLinkTarget(value: string) {\n this._externalLinkTarget = value;\n }\n\n \n set autoresize(value: boolean) {\n this._canAutoResize = Boolean(value);\n }\n\n \n set fitToPage(value: boolean) {\n this._fitToPage = Boolean(value);\n }\n\n public setupViewer() {\n (PDFJS).disableTextLayer = !this._renderText;\n\n PdfViewerComponent.setExternalLinkTarget(this._externalLinkTarget);\n\n this._pdfLinkService = new (PDFJS).PDFLinkService();\n\n const pdfOptions: PDFViewerParams | any = {\n container: this.element.nativeElement.querySelector('div'),\n removePageBorders: true,\n linkService: this._pdfLinkService\n };\n\n this._pdfViewer = new PDFJS.PDFViewer(pdfOptions);\n this._pdfLinkService.setViewer(this._pdfViewer);\n }\n\n public updateSize() {\n if (!this._showAll) {\n this.renderPage(this._page);\n return;\n }\n\n this._pdf.getPage(this._pdfViewer.currentPageNumber).then((page: PDFPageProxy) => {\n const viewport = page.getViewport(this._zoom, this._rotation);\n let scale = this._zoom;\n let stickToPage = true;\n\n // Scale the document when it shouldn't be in original size or doesn't fit into the viewport\n if (!this._originalSize || (this._fitToPage && viewport.width > this.element.nativeElement.offsetWidth)) {\n scale = this.getScale(page.getViewport(1).width);\n stickToPage = !this._stickToPage;\n }\n\n this._pdfViewer._setScale(scale, stickToPage);\n });\n }\n\n private isValidPageNumber(page: number): boolean {\n return this._pdf.numPages >= page && page >= 1;\n }\n\n static setExternalLinkTarget(type: string) {\n switch (type) {\n case 'blank':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.BLANK;\n break;\n case 'none':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.NONE;\n break;\n case 'self':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.SELF;\n break;\n case 'parent':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.PARENT;\n break;\n case 'top':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.TOP;\n break;\n }\n }\n\n private loadPDF() {\n if (!this.src) {\n return;\n }\n\n if (this.lastLoaded === this.src) {\n this.update();\n return;\n }\n\n let loadingTask: any = PDFJS.getDocument(this.src as any);\n\n loadingTask.onProgress = (progressData: PDFProgressData) => {\n this.onProgress.emit(progressData);\n };\n\n const src = this.src;\n (>loadingTask.promise)\n .then((pdf: PDFDocumentProxy) => {\n this._pdf = pdf;\n this.lastLoaded = src;\n\n this.afterLoadComplete.emit(pdf);\n\n this.update();\n }, (error: any) => {\n this.onError.emit(error);\n });\n }\n\n private update() {\n if (this._showAll) {\n this.setupViewer();\n\n if (this._pdfViewer) {\n this._pdfViewer.setDocument(this._pdf);\n }\n }\n\n if (this._pdfLinkService) {\n this._pdfLinkService.setDocument(this._pdf, null);\n }\n\n this.page = this._page;\n\n this.render();\n }\n\n private render() {\n if (this._showAll) {\n this.renderMultiplePages();\n } else {\n this.renderPage(this._page);\n }\n }\n\n private renderMultiplePages() {\n if (!this.isValidPageNumber(this._page)) {\n this._page = 1;\n }\n\n if (this._rotation !== 0 || this._pdfViewer.pagesRotation !== this._rotation) {\n setTimeout(() => {\n this._pdfViewer.pagesRotation = this._rotation;\n });\n }\n\n if (this._stickToPage) {\n setTimeout(() => {\n this._pdfViewer.currentPageNumber = this._page;\n });\n }\n\n this.updateSize();\n }\n\n private renderPage(pageNumber: number) {\n this._pdf.getPage(pageNumber).then( (page: PDFPageProxy) => {\n let viewport = page.getViewport(this._zoom, this._rotation);\n let container = this.element.nativeElement.querySelector('.pdfViewer');\n let scale = this._zoom;\n\n // Scale the document when it shouldn't be in original size or doesn't fit into the viewport\n if (!this._originalSize || (this._fitToPage && viewport.width > this.element.nativeElement.offsetWidth)) {\n viewport = page.getViewport(this.element.nativeElement.offsetWidth / viewport.width, this._rotation);\n scale = this.getScale(page.getViewport(1).width);\n }\n\n PdfViewerComponent.removeAllChildNodes(container);\n\n (PDFJS).disableTextLayer = !this._renderText;\n\n let pdfOptions: PDFViewerParams | any = {\n container,\n removePageBorders: true,\n defaultViewport: viewport,\n scale,\n id: this._page,\n };\n\n if (this._renderText) {\n this._pdfLinkService = new (PDFJS).PDFLinkService();\n pdfOptions.linkService = this._pdfLinkService;\n PdfViewerComponent.setExternalLinkTarget(this._externalLinkTarget);\n pdfOptions.textLayerFactory = new (PDFJS).DefaultTextLayerFactory();\n pdfOptions.annotationLayerFactory = new (PDFJS).DefaultAnnotationLayerFactory();\n }\n\n let pdfPageView = new (PDFJS).PDFPageView(pdfOptions);\n\n if (this._renderText) {\n this._pdfLinkService.setViewer(pdfPageView);\n }\n\n if (this._rotation !== 0 || pdfPageView.rotation !== this._rotation) {\n pdfPageView.rotation = this._rotation;\n }\n\n pdfPageView.setPdfPage(page);\n return pdfPageView.draw();\n });\n }\n\n static removeAllChildNodes(element: HTMLElement) {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n }\n\n private getScale(viewportWidth) {\n const offsetWidth = this.element.nativeElement.offsetWidth;\n\n if (offsetWidth === 0) {\n return 1;\n }\n\n return this._zoom * (offsetWidth / viewportWidth) / PdfViewerComponent.CSS_UNITS;\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n selector: 'pdf-viewer',\n template: `
`,\n styles: [\n`\n.ng2-pdf-viewer-container {\n overflow-x: auto;\n}\n:host /deep/ .textLayer {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n opacity: 0.2;\n line-height: 1.0;\n}\n\n:host /deep/ .textLayer > div {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n -webkit-transform-origin: 0% 0%;\n -moz-transform-origin: 0% 0%;\n -o-transform-origin: 0% 0%;\n -ms-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n}\n\n:host /deep/ .textLayer .highlight {\n margin: -1px;\n padding: 1px;\n\n background-color: #002bff;\n border-radius: 4px;\n}\n\n:host /deep/ .textLayer .highlight.begin {\n border-radius: 4px 0px 0px 4px;\n}\n\n:host /deep/ .textLayer .highlight.end {\n border-radius: 0px 4px 4px 0px;\n}\n\n:host /deep/ .textLayer .highlight.middle {\n border-radius: 0px;\n}\n\n:host /deep/ .textLayer .highlight.selected {\n background-color: rgb(0, 100, 0);\n}\n\n:host /deep/ .textLayer ::selection { background: #002bff; }\n:host /deep/ .textLayer ::-moz-selection { background: #002bff; }\n\n:host /deep/ .textLayer .endOfContent {\n display: block;\n position: absolute;\n left: 0px;\n top: 100%;\n right: 0px;\n bottom: 0px;\n z-index: -1;\n cursor: default;\n -webkit-user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n}\n\n:host /deep/ .textLayer .endOfContent.active {\n top: 0px;\n}\n\n\n:host /deep/ .annotationLayer section {\n position: absolute;\n}\n\n:host /deep/ .annotationLayer .linkAnnotation > a {\n position: absolute;\n font-size: 1em;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n:host /deep/ .annotationLayer .linkAnnotation > a /* -ms-a */ {\n background: url(\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\") 0 0 repeat;\n}\n\n:host /deep/ .annotationLayer .linkAnnotation > a:hover {\n opacity: 0.2;\n background: #002bff;\n box-shadow: 0px 2px 10px #002bff;\n}\n\n:host /deep/ .annotationLayer .textAnnotation img {\n position: absolute;\n cursor: pointer;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input,\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea,\n:host /deep/ .annotationLayer .choiceWidgetAnnotation select,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.checkBox input,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.radioButton input {\n background-color: #002bff;\n border: 1px solid transparent;\n box-sizing: border-box;\n font-size: 9px;\n height: 100%;\n padding: 0 3px;\n vertical-align: top;\n width: 100%;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea {\n font: message-box;\n font-size: 9px;\n resize: none;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input[disabled],\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea[disabled],\n:host /deep/ .annotationLayer .choiceWidgetAnnotation select[disabled],\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {\n background: none;\n border: 1px solid transparent;\n cursor: not-allowed;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input:hover,\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea:hover,\n:host /deep/ .annotationLayer .choiceWidgetAnnotation select:hover,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.checkBox input:hover,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.radioButton input:hover {\n border: 1px solid #000;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input:focus,\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea:focus,\n:host /deep/ .annotationLayer .choiceWidgetAnnotation select:focus {\n background: none;\n border: 1px solid transparent;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input.comb {\n font-family: monospace;\n padding-left: 2px;\n padding-right: 0;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input.comb:focus {\n width: 115%;\n}\n\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.checkBox input,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.radioButton input {\n -webkit-appearance: none;\n -moz-appearance: none;\n -ms-appearance: none;\n appearance: none;\n}\n\n:host /deep/ .annotationLayer .popupWrapper {\n position: absolute;\n width: 20em;\n}\n\n:host /deep/ .annotationLayer .popup {\n position: absolute;\n z-index: 200;\n max-width: 20em;\n background-color: #FFFF99;\n box-shadow: 0px 2px 5px #333;\n border-radius: 2px;\n padding: 0.6em;\n margin-left: 5px;\n cursor: pointer;\n word-wrap: break-word;\n}\n\n:host /deep/ .annotationLayer .popup h1 {\n font-size: 1em;\n border-bottom: 1px solid #000000;\n padding-bottom: 0.2em;\n}\n\n:host /deep/ .annotationLayer .popup p {\n padding-top: 0.2em;\n}\n\n:host /deep/ .annotationLayer .highlightAnnotation,\n:host /deep/ .annotationLayer .underlineAnnotation,\n:host /deep/ .annotationLayer .squigglyAnnotation,\n:host /deep/ .annotationLayer .strikeoutAnnotation,\n:host /deep/ .annotationLayer .fileAttachmentAnnotation {\n cursor: pointer;\n}\n\n:host /deep/ .pdfViewer .canvasWrapper {\n overflow: hidden;\n}\n\n:host /deep/ .pdfViewer .page {\n direction: ltr;\n width: 816px;\n height: 1056px;\n margin: 1px auto -8px auto;\n position: relative;\n overflow: visible;\n border: 9px solid transparent;\n background-clip: content-box;\n border-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAA6UlEQVR4Xl2Pi2rEMAwE16fm1f7/r14v7w4rI0IzLAF7hLxNevBSEMEF5+OilNCsRd8ZMyn+a4NmsOT8WJw1lFbSYgGFzF2bLFoLjTClWjKKGRWpDYAGXUnZ4uhbBUzF3Oe/GG/ue2fn4GgsyXhNgysV2JnrhKEMg4fEZcALmiKbNhBBRFpSyDOj1G4QOVly6O1FV54ZZq8OVygrciDt6JazRgi1ljTPH0gbrPmHPXAbCiDd4GawIjip1TPh9tt2sz24qaCjr/jAb/GBFTbq9KZ7Ke/Cqt8nayUikZKsWZK7Fe6bg5dOUt8fZHWG2BHc+6EAAAAASUVORK5CYII=') 9 9 repeat;\n background-color: white;\n}\n\n:host /deep/ .pdfViewer.removePageBorders .page {\n margin: 0px auto 10px auto;\n border: none;\n}\n\n:host /deep/ .pdfViewer.singlePageView {\n display: inline-block;\n}\n\n:host /deep/ .pdfViewer.singlePageView .page {\n margin: 0;\n border: none;\n}\n\n:host /deep/ .pdfViewer .page canvas {\n margin: 0;\n display: block;\n}\n\n:host /deep/ .pdfViewer .page .loadingIcon {\n position: absolute;\n display: block;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background: url('data:image/gif;base64,R0lGODlhGAAYAPQAAP///wAAAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQJBwAAACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIhezwhENTCQEoeGCdWIPEgz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tob0ZTPgNrIwQJDgtGAgwCWSIMDg4HiiUIDAxFAAoODwxDBWINCEGdSTQkCQcoegADBaQ6MggHjwAFBZUFCm0HB0kJCUy9bAYHCCPGIwqmRq0jySMGmj6yRiEAIfkECQcAAAAsAAAAABgAGAAABbIgII4k0DRlmg6kYZCsOg4EKhLE2BCxDOAxnIiW84l2L4BLZKipBopW8XRLDkeCiAMyMvQAA+uON4JEIo+vqukkKQ6RhLHplVGN+LyKcXA4Dgx5DWwGDXx+gIKENnqNdzIDaiMECwcFRgQCCowiCAcHCZIlCgICVgSfCEMMnA0CXaU2YSQFoQAKUQMMqjoyAglcAAyBAAIMRUYLCUkFlybDeAYJryLNk6xGNCTQXY0juHghACH5BAkHAAAALAAAAAAYABgAAAWzICCOJNA0ZVoOAmkY5KCSSgSNBDE2hDyLjohClBMNij8RJHIQvZwEVOpIekRQJyJs5AMoHA+GMbE1lnm9EcPhOHRnhpwUl3AsknHDm5RN+v8qCAkHBwkIfw1xBAYNgoSGiIqMgJQifZUjBhAJYj95ewIJCQV7KYpzBAkLLQADCHOtOpY5PgNlAAykAEUsQ1wzCgWdCIdeArczBQVbDJ0NAqyeBb64nQAGArBTt8R8mLuyPyEAOwAAAAAAAAAAAA==') center no-repeat;\n}\n`\n ]\n}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ElementRef, },\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'afterLoadComplete': [{ type: Output, args: ['after-load-complete', ] },],\n'onError': [{ type: Output, args: ['error', ] },],\n'onProgress': [{ type: Output, args: ['on-progress', ] },],\n'onPageResize': [{ type: HostListener, args: ['window:resize', [], ] },],\n'src': [{ type: Input },],\n'page': [{ type: Input, args: ['page', ] },],\n'pageChange': [{ type: Output },],\n'renderText': [{ type: Input, args: ['render-text', ] },],\n'originalSize': [{ type: Input, args: ['original-size', ] },],\n'showAll': [{ type: Input, args: ['show-all', ] },],\n'stickToPage': [{ type: Input, args: ['stick-to-page', ] },],\n'zoom': [{ type: Input, args: ['zoom', ] },],\n'rotation': [{ type: Input, args: ['rotation', ] },],\n'externalLinkTarget': [{ type: Input, args: ['external-link-target', ] },],\n'autoresize': [{ type: Input, args: ['autoresize', ] },],\n'fitToPage': [{ type: Input, args: ['fit-to-page', ] },],\n};\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../src/pdf-viewer/pdf-viewer.component.ts"],"names":[],"mappings":";;AAGA,sCAEuB;AAGvB;IACE,MAAM,CAAC,OAAO,MAAA,KAAW,WAAA,CAAY;AACvC,CAAC;AAED,EAAE,CAAC,CAAC,CAAC,KAAC,EAAK,CAAE,CAAC,CAAA;IACZ,MAAM,CAAC,sBAAC,CAAsB,GAAG,OAAA,CAAQ,sBAAC,CAAsB,CAAC;IACjE,OAAO,CAAC,8BAAC,CAA8B,CAAC;IACxC,OAAO,CAAC,2BAAC,CAA2B,CAAC;IAErC,KAAK,CAAC,SAAC,GAAiB,KAAM,CAAC,gBAAC,CAAgB,MAAC,CAAM;AACzD,CAAC;AAID;IAuBE,4BAAoB,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;QApB/B,gBAAW,GAAY,IAAI,CAAC;QAC5B,iBAAY,GAAY,KAAK,CAAC;QAC9B,kBAAa,GAAY,IAAI,CAAC;QAE9B,UAAK,GAAW,CAAC,CAAC;QAClB,UAAK,GAAW,CAAC,CAAC;QAClB,cAAS,GAAW,CAAC,CAAC;QACtB,aAAQ,GAAY,IAAI,CAAC;QACzB,mBAAc,GAAY,IAAI,CAAC;QAC/B,eAAU,GAAY,KAAK,CAAC;QAC5B,wBAAmB,GAAW,OAAO,CAAC;QAM7C,sBAAiB,GAAG,IAAI,mBAAY,EAAoB,CAAC;QACzD,YAAO,GAAG,IAAI,mBAAY,EAAO,CAAC;QAClC,eAAU,GAAG,IAAI,mBAAY,EAAmB,CAAC;QA2DjD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AAE,IAAI,EAAE,CAAC,aAAa,EAAG,EAAE,EAAE;QACzD,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,YAAK,EAAE,IAAI,EAAE,CAAC,eAAe,EAAG,EAAE,EAAE;QAC7D,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,YAAK,EAAE,IAAI,EAAE,CAAC,UAAU,EAAG,EAAE,EAAE;QACnD,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,YAAK,EAAE,IAAI,EAAE,CAAC,eAAe,EAAG,EAAE,EAAE;QAC5D,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,YAAK,EAAE,IAAI,EAAE,CAAC,MAAM,EAAG,EAAE,EAAE;QAC5C,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,YAAK,EAAE,IAAI,EAAE,CAAC,UAAU,EAAG,EAAE,EAAE;QACpD,oBAAoB,EAAE,CAAC,EAAE,IAAI,EAAE,YAAK,EAAE,IAAI,EAAE,CAAC,sBAAsB,EAAG,EAAE,EAAE;QAC1E,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,YAAK,EAAE,IAAI,EAAE,CAAC,YAAY,EAAG,EAAE,EAAE;QACxD,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,YAAK,EAAE,IAAI,EAAE,CAAC,aAAa,EAAG,EAAE,EAAE;KACvD,CAAC;IACF,yBAAC;CAzmBD,AAymBC,IAAA;AAzmBY,gDAAkB","file":"pdf-viewer.component.js","sourceRoot":"","sourcesContent":["/**\n * Created by vadimdez on 21/06/16.\n */\nimport {\n Component, Input, Output, ElementRef, EventEmitter, OnChanges, SimpleChanges, OnInit, HostListener\n} from '@angular/core';\nimport { PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';\n\nfunction isSSR() {\n return typeof window === 'undefined';\n}\n\nif (!isSSR()) {\n window['pdfjs-dist/build/pdf'] = require('pdfjs-dist/build/pdf');\n require('pdfjs-dist/web/compatibility');\n require('pdfjs-dist/web/pdf_viewer');\n\n PDFJS.verbosity = (PDFJS).VERBOSITY_LEVELS.errors;\n}\n\n\n\nexport class PdfViewerComponent implements OnChanges, OnInit {\n static CSS_UNITS: number = 96.0 / 72.0;\n\n private _renderText: boolean = true;\n private _stickToPage: boolean = false;\n private _originalSize: boolean = true;\n private _pdf: PDFDocumentProxy;\n private _page: number = 1;\n private _zoom: number = 1;\n private _rotation: number = 0;\n private _showAll: boolean = true;\n private _canAutoResize: boolean = true;\n private _fitToPage: boolean = false;\n private _externalLinkTarget: string = 'blank';\n private _pdfViewer: any;\n private _pdfLinkService: any;\n private lastLoaded: string | Uint8Array | PDFSource;\n private resizeTimeout: NodeJS.Timer;\n\n afterLoadComplete = new EventEmitter();\n onError = new EventEmitter();\n onProgress = new EventEmitter();\n\n constructor(private element: ElementRef) {\n if (!isSSR() && typeof PDFJS.workerSrc !== 'string') {\n PDFJS.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${ (PDFJS as any).version }/pdf.worker.min.js`;\n }\n }\n\n ngOnInit() {\n if (!isSSR()) {\n this.setupViewer();\n }\n }\n\n \n public onPageResize() {\n if (!this._canAutoResize) {\n return;\n }\n\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n }\n\n this.resizeTimeout = setTimeout(() => {\n this.updateSize();\n }, 100);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (isSSR()) {\n return;\n }\n\n if ('src' in changes) {\n this.loadPDF();\n } else if (this._pdf) {\n if ('renderText' in changes) {\n this.setupViewer();\n }\n this.update();\n }\n }\n\n \n src: string | Uint8Array | PDFSource;\n\n \n set page(_page) {\n _page = parseInt(_page, 10);\n\n if (this._pdf && !this.isValidPageNumber(_page)) {\n _page = 1;\n }\n\n this._page = _page;\n this.pageChange.emit(_page);\n }\n\n pageChange: EventEmitter = new EventEmitter(true);\n\n \n set renderText(renderText: boolean) {\n this._renderText = renderText;\n }\n\n \n set originalSize(originalSize: boolean) {\n this._originalSize = originalSize;\n }\n\n \n set showAll(value: boolean) {\n this._showAll = value;\n }\n\n \n set stickToPage(value: boolean) {\n this._stickToPage = value;\n }\n\n \n set zoom(value: number) {\n if (value <= 0) {\n return;\n }\n\n this._zoom = value;\n }\n\n get zoom() {\n return this._zoom;\n }\n\n \n set rotation(value: number) {\n if (!(typeof value === 'number' && value % 90 === 0)) {\n console.warn('Invalid pages rotation angle.');\n return;\n }\n\n this._rotation = value;\n }\n\n \n set externalLinkTarget(value: string) {\n this._externalLinkTarget = value;\n }\n\n \n set autoresize(value: boolean) {\n this._canAutoResize = Boolean(value);\n }\n\n \n set fitToPage(value: boolean) {\n this._fitToPage = Boolean(value);\n }\n\n public setupViewer() {\n (PDFJS).disableTextLayer = !this._renderText;\n\n PdfViewerComponent.setExternalLinkTarget(this._externalLinkTarget);\n\n this._pdfLinkService = new (PDFJS).PDFLinkService();\n\n const pdfOptions: PDFViewerParams | any = {\n container: this.element.nativeElement.querySelector('div'),\n removePageBorders: true,\n linkService: this._pdfLinkService\n };\n\n this._pdfViewer = new PDFJS.PDFViewer(pdfOptions);\n this._pdfLinkService.setViewer(this._pdfViewer);\n }\n\n public updateSize() {\n if (!this._showAll) {\n this.renderPage(this._page);\n return;\n }\n\n this._pdf.getPage(this._pdfViewer.currentPageNumber).then((page: PDFPageProxy) => {\n const viewport = page.getViewport(this._zoom, this._rotation);\n let scale = this._zoom;\n let stickToPage = true;\n\n // Scale the document when it shouldn't be in original size or doesn't fit into the viewport\n if (!this._originalSize || (this._fitToPage && viewport.width > this.element.nativeElement.offsetWidth)) {\n scale = this.getScale(page.getViewport(1).width);\n stickToPage = !this._stickToPage;\n }\n\n this._pdfViewer._setScale(scale, stickToPage);\n });\n }\n\n private isValidPageNumber(page: number): boolean {\n return this._pdf.numPages >= page && page >= 1;\n }\n\n static setExternalLinkTarget(type: string) {\n switch (type) {\n case 'blank':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.BLANK;\n break;\n case 'none':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.NONE;\n break;\n case 'self':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.SELF;\n break;\n case 'parent':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.PARENT;\n break;\n case 'top':\n (PDFJS).externalLinkTarget = (PDFJS).LinkTarget.TOP;\n break;\n }\n }\n\n private loadPDF() {\n if (!this.src) {\n return;\n }\n\n if (this.lastLoaded === this.src) {\n this.update();\n return;\n }\n\n let loadingTask: any = PDFJS.getDocument(this.src as any);\n\n loadingTask.onProgress = (progressData: PDFProgressData) => {\n this.onProgress.emit(progressData);\n };\n\n const src = this.src;\n (>loadingTask.promise)\n .then((pdf: PDFDocumentProxy) => {\n this._pdf = pdf;\n this.lastLoaded = src;\n\n this.afterLoadComplete.emit(pdf);\n\n this.update();\n }, (error: any) => {\n this.onError.emit(error);\n });\n }\n\n private update() {\n if (this._showAll) {\n this.setupViewer();\n\n if (this._pdfViewer) {\n this._pdfViewer.setDocument(this._pdf);\n }\n }\n\n if (this._pdfLinkService) {\n this._pdfLinkService.setDocument(this._pdf, null);\n }\n\n this.page = this._page;\n\n this.render();\n }\n\n private render() {\n if (this._showAll) {\n this.renderMultiplePages();\n } else {\n this.renderPage(this._page);\n }\n }\n\n private renderMultiplePages() {\n if (!this.isValidPageNumber(this._page)) {\n this._page = 1;\n }\n\n if (this._rotation !== 0 || this._pdfViewer.pagesRotation !== this._rotation) {\n setTimeout(() => {\n this._pdfViewer.pagesRotation = this._rotation;\n });\n }\n\n if (this._stickToPage) {\n setTimeout(() => {\n this._pdfViewer.currentPageNumber = this._page;\n });\n }\n\n this.updateSize();\n }\n\n private renderPage(pageNumber: number) {\n this._pdf.getPage(pageNumber).then( (page: PDFPageProxy) => {\n let viewport = page.getViewport(this._zoom, this._rotation);\n let container = this.element.nativeElement.querySelector('.pdfViewer');\n let scale = this._zoom;\n\n // Scale the document when it shouldn't be in original size or doesn't fit into the viewport\n if (!this._originalSize || (this._fitToPage && viewport.width > this.element.nativeElement.offsetWidth)) {\n viewport = page.getViewport(this.element.nativeElement.offsetWidth / viewport.width, this._rotation);\n scale = this.getScale(page.getViewport(1).width);\n }\n\n PdfViewerComponent.removeAllChildNodes(container);\n\n (PDFJS).disableTextLayer = !this._renderText;\n\n let pdfOptions: PDFViewerParams | any = {\n container,\n removePageBorders: true,\n defaultViewport: viewport,\n scale,\n id: this._page,\n };\n\n if (this._renderText) {\n this._pdfLinkService = new (PDFJS).PDFLinkService();\n pdfOptions.linkService = this._pdfLinkService;\n PdfViewerComponent.setExternalLinkTarget(this._externalLinkTarget);\n pdfOptions.textLayerFactory = new (PDFJS).DefaultTextLayerFactory();\n pdfOptions.annotationLayerFactory = new (PDFJS).DefaultAnnotationLayerFactory();\n }\n\n let pdfPageView = new (PDFJS).PDFPageView(pdfOptions);\n\n if (this._renderText) {\n this._pdfLinkService.setViewer(pdfPageView);\n }\n\n if (this._rotation !== 0 || pdfPageView.rotation !== this._rotation) {\n pdfPageView.rotation = this._rotation;\n }\n\n pdfPageView.setPdfPage(page);\n return pdfPageView.draw();\n });\n }\n\n static removeAllChildNodes(element: HTMLElement) {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n }\n\n private getScale(viewportWidth) {\n const offsetWidth = this.element.nativeElement.offsetWidth;\n\n if (offsetWidth === 0) {\n return 1;\n }\n\n return this._zoom * (offsetWidth / viewportWidth) / PdfViewerComponent.CSS_UNITS;\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n selector: 'pdf-viewer',\n template: `
`,\n styles: [\n`\n.ng2-pdf-viewer-container {\n overflow-x: auto;\n}\n:host /deep/ .textLayer {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n opacity: 0.2;\n line-height: 1.0;\n}\n\n:host /deep/ .textLayer > div {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n -webkit-transform-origin: 0% 0%;\n -moz-transform-origin: 0% 0%;\n -o-transform-origin: 0% 0%;\n -ms-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n}\n\n:host /deep/ .textLayer .highlight {\n margin: -1px;\n padding: 1px;\n\n background-color: #002bff;\n border-radius: 4px;\n}\n\n:host /deep/ .textLayer .highlight.begin {\n border-radius: 4px 0px 0px 4px;\n}\n\n:host /deep/ .textLayer .highlight.end {\n border-radius: 0px 4px 4px 0px;\n}\n\n:host /deep/ .textLayer .highlight.middle {\n border-radius: 0px;\n}\n\n:host /deep/ .textLayer .highlight.selected {\n background-color: rgb(0, 100, 0);\n}\n\n:host /deep/ .textLayer ::selection { background: #002bff; }\n:host /deep/ .textLayer ::-moz-selection { background: #002bff; }\n\n:host /deep/ .textLayer .endOfContent {\n display: block;\n position: absolute;\n left: 0px;\n top: 100%;\n right: 0px;\n bottom: 0px;\n z-index: -1;\n cursor: default;\n -webkit-user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n}\n\n:host /deep/ .textLayer .endOfContent.active {\n top: 0px;\n}\n\n\n:host /deep/ .annotationLayer section {\n position: absolute;\n}\n\n:host /deep/ .annotationLayer .linkAnnotation > a {\n position: absolute;\n font-size: 1em;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n:host /deep/ .annotationLayer .linkAnnotation > a /* -ms-a */ {\n background: url(\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\") 0 0 repeat;\n}\n\n:host /deep/ .annotationLayer .linkAnnotation > a:hover {\n opacity: 0.2;\n background: #002bff;\n box-shadow: 0px 2px 10px #002bff;\n}\n\n:host /deep/ .annotationLayer .textAnnotation img {\n position: absolute;\n cursor: pointer;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input,\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea,\n:host /deep/ .annotationLayer .choiceWidgetAnnotation select,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.checkBox input,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.radioButton input {\n background-color: #002bff;\n border: 1px solid transparent;\n box-sizing: border-box;\n font-size: 9px;\n height: 100%;\n padding: 0 3px;\n vertical-align: top;\n width: 100%;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea {\n font: message-box;\n font-size: 9px;\n resize: none;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input[disabled],\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea[disabled],\n:host /deep/ .annotationLayer .choiceWidgetAnnotation select[disabled],\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {\n background: none;\n border: 1px solid transparent;\n cursor: not-allowed;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input:hover,\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea:hover,\n:host /deep/ .annotationLayer .choiceWidgetAnnotation select:hover,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.checkBox input:hover,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.radioButton input:hover {\n border: 1px solid #000;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input:focus,\n:host /deep/ .annotationLayer .textWidgetAnnotation textarea:focus,\n:host /deep/ .annotationLayer .choiceWidgetAnnotation select:focus {\n background: none;\n border: 1px solid transparent;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input.comb {\n font-family: monospace;\n padding-left: 2px;\n padding-right: 0;\n}\n\n:host /deep/ .annotationLayer .textWidgetAnnotation input.comb:focus {\n width: 115%;\n}\n\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.checkBox input,\n:host /deep/ .annotationLayer .buttonWidgetAnnotation.radioButton input {\n -webkit-appearance: none;\n -moz-appearance: none;\n -ms-appearance: none;\n appearance: none;\n}\n\n:host /deep/ .annotationLayer .popupWrapper {\n position: absolute;\n width: 20em;\n}\n\n:host /deep/ .annotationLayer .popup {\n position: absolute;\n z-index: 200;\n max-width: 20em;\n background-color: #FFFF99;\n box-shadow: 0px 2px 5px #333;\n border-radius: 2px;\n padding: 0.6em;\n margin-left: 5px;\n cursor: pointer;\n word-wrap: break-word;\n}\n\n:host /deep/ .annotationLayer .popup h1 {\n font-size: 1em;\n border-bottom: 1px solid #000000;\n padding-bottom: 0.2em;\n}\n\n:host /deep/ .annotationLayer .popup p {\n padding-top: 0.2em;\n}\n\n:host /deep/ .annotationLayer .highlightAnnotation,\n:host /deep/ .annotationLayer .underlineAnnotation,\n:host /deep/ .annotationLayer .squigglyAnnotation,\n:host /deep/ .annotationLayer .strikeoutAnnotation,\n:host /deep/ .annotationLayer .fileAttachmentAnnotation {\n cursor: pointer;\n}\n\n:host /deep/ .pdfViewer .canvasWrapper {\n overflow: hidden;\n}\n\n:host /deep/ .pdfViewer .page {\n direction: ltr;\n width: 816px;\n height: 1056px;\n margin: 1px auto -8px auto;\n position: relative;\n overflow: visible;\n border: 9px solid transparent;\n background-clip: content-box;\n border-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAA6UlEQVR4Xl2Pi2rEMAwE16fm1f7/r14v7w4rI0IzLAF7hLxNevBSEMEF5+OilNCsRd8ZMyn+a4NmsOT8WJw1lFbSYgGFzF2bLFoLjTClWjKKGRWpDYAGXUnZ4uhbBUzF3Oe/GG/ue2fn4GgsyXhNgysV2JnrhKEMg4fEZcALmiKbNhBBRFpSyDOj1G4QOVly6O1FV54ZZq8OVygrciDt6JazRgi1ljTPH0gbrPmHPXAbCiDd4GawIjip1TPh9tt2sz24qaCjr/jAb/GBFTbq9KZ7Ke/Cqt8nayUikZKsWZK7Fe6bg5dOUt8fZHWG2BHc+6EAAAAASUVORK5CYII=') 9 9 repeat;\n background-color: white;\n}\n\n:host /deep/ .pdfViewer.removePageBorders .page {\n margin: 0px auto 10px auto;\n border: none;\n}\n\n:host /deep/ .pdfViewer.singlePageView {\n display: inline-block;\n}\n\n:host /deep/ .pdfViewer.singlePageView .page {\n margin: 0;\n border: none;\n}\n\n:host /deep/ .pdfViewer .page canvas {\n margin: 0;\n display: block;\n}\n\n:host /deep/ .pdfViewer .page .loadingIcon {\n position: absolute;\n display: block;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background: url('data:image/gif;base64,R0lGODlhGAAYAPQAAP///wAAAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQJBwAAACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIhezwhENTCQEoeGCdWIPEgzESGxEIgGBWstEW4QCGGAIJEoxGmGt5ZkgCRQQHkGd2CESoeIIwoMBQUMP4cNeQQGDYuNj4iSb5WJnmeGng0CDGaBlIQEJziHk3sABidDAHBgagButSKvAAoyuHuUYHgCkAZqebw0AgLBQyyzNKO3byNuoSS8x8OfwIchACH5BAkHAAAALAAAAAAYABgAAAW4ICCOJIAgZVoOBJkkpDKoo5EI43GMjNPSokXCINKJCI4HcCRIQEQvqIOhGhBHhUTDhGo4diOZyFAoKEQDxra2mAEgjghOpCgz3LTBIxJ5kgwMBShACREHZ1V4Kg1rS44pBAgMDAg/Sw0GBAQGDZGTlY+YmpyP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BAAIMRUYLCUkFlybDeAYJryLNk6xGNCTQXY0juHghACH5BAkHAAAALAAAAAAYABgAAAWzICCOJNA0ZVoOAmkY5KCSSgSNBDE2hDyLjohClBMNij8RJHIQvZwEVOpIekRQJyJs5AMoHA+GMbE1lnm9EcPhOHRnhpwUl3AsknHDm5RN+v8qCAkHBwkIfw1xBAYNgoSGiIqMgJQifZUjBhAJYj95ewIJCQV7KYpzBAkLLQADCHOtOpY5PgNlAAykAEUsQ1wzCgWdCIdeArczBQVbDJ0NAqyeBb64nQAGArBTt8R8mLuyPyEAOwAAAAAAAAAAAA==') center no-repeat;\n}\n`\n ]\n}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ElementRef, },\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'afterLoadComplete': [{ type: Output, args: ['after-load-complete', ] },],\n'onError': [{ type: Output, args: ['error', ] },],\n'onProgress': [{ type: Output, args: ['on-progress', ] },],\n'onPageResize': [{ type: HostListener, args: ['window:resize', [], ] },],\n'src': [{ type: Input },],\n'page': [{ type: Input, args: ['page', ] },],\n'pageChange': [{ type: Output },],\n'renderText': [{ type: Input, args: ['render-text', ] },],\n'originalSize': [{ type: Input, args: ['original-size', ] },],\n'showAll': [{ type: Input, args: ['show-all', ] },],\n'stickToPage': [{ type: Input, args: ['stick-to-page', ] },],\n'zoom': [{ type: Input, args: ['zoom', ] },],\n'rotation': [{ type: Input, args: ['rotation', ] },],\n'externalLinkTarget': [{ type: Input, args: ['external-link-target', ] },],\n'autoresize': [{ type: Input, args: ['autoresize', ] },],\n'fitToPage': [{ type: Input, args: ['fit-to-page', ] },],\n};\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]} \ No newline at end of file diff --git a/dist/index.metadata.json b/dist/index.metadata.json index 052127f9a..cecdddd89 100644 --- a/dist/index.metadata.json +++ b/dist/index.metadata.json @@ -1 +1 @@ -[{"__symbolic":"module","version":3,"metadata":{"PdfViewerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}],"exports":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}]}]}]}}},{"__symbolic":"module","version":1,"metadata":{"PdfViewerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}],"exports":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}]}]}]}}}] \ No newline at end of file +[{"__symbolic":"module","version":3,"metadata":{"PdfViewerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}],"exports":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}]}]}]}},"exports":[{"from":"pdfjs-dist","export":["PDFJSStatic","PDFDocumentProxy","PDFViewerParams","PDFPageProxy","PDFSource","PDFProgressData","PDFPromise"]}]},{"__symbolic":"module","version":1,"metadata":{"PdfViewerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}],"exports":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}]}]}]}},"exports":[{"from":"pdfjs-dist","export":["PDFJSStatic","PDFDocumentProxy","PDFViewerParams","PDFPageProxy","PDFSource","PDFProgressData","PDFPromise"]}]}] \ No newline at end of file diff --git a/dist/pdf-viewer.component.d.ts b/dist/pdf-viewer.component.d.ts index c61ec4165..e57a8d210 100644 --- a/dist/pdf-viewer.component.d.ts +++ b/dist/pdf-viewer.component.d.ts @@ -1,9 +1,6 @@ /// import { ElementRef, EventEmitter, OnChanges, SimpleChanges, OnInit } from '@angular/core'; -import { PDFJSStatic, PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist'; -declare global { - const PDFJS: PDFJSStatic; -} +import { PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist'; export declare class PdfViewerComponent implements OnChanges, OnInit { private element; static CSS_UNITS: number; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ab14593fd..72f92485f 100755 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -59,7 +59,7 @@ export class AppComponent { * Set custom path to pdf worker */ setCustomWorkerPath() { - PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js'; + (window).PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js'; } incrementPage(amount: number) { diff --git a/src/pdf-viewer/index.ts b/src/pdf-viewer/index.ts index f8b1e7eee..86a31d51f 100644 --- a/src/pdf-viewer/index.ts +++ b/src/pdf-viewer/index.ts @@ -4,6 +4,13 @@ import { NgModule } from '@angular/core'; import { PdfViewerComponent } from './pdf-viewer.component'; +import { PDFJSStatic } from "pdfjs-dist"; + +declare global { + const PDFJS: PDFJSStatic; +} + +export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist'; @NgModule({ declarations: [PdfViewerComponent], diff --git a/src/pdf-viewer/pdf-viewer.component.ts b/src/pdf-viewer/pdf-viewer.component.ts index 9925eb982..e2e0eb03b 100644 --- a/src/pdf-viewer/pdf-viewer.component.ts +++ b/src/pdf-viewer/pdf-viewer.component.ts @@ -4,11 +4,7 @@ import { Component, Input, Output, ElementRef, EventEmitter, OnChanges, SimpleChanges, OnInit, HostListener } from '@angular/core'; -import { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist'; - -declare global { - const PDFJS: PDFJSStatic; -} +import { PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist'; function isSSR() { return typeof window === 'undefined'; @@ -22,7 +18,6 @@ if (!isSSR()) { PDFJS.verbosity = (PDFJS).VERBOSITY_LEVELS.errors; } - @Component({ selector: 'pdf-viewer', template: `
`,