@amaplex-software/ng2-pdf-viewer
Version:
Angular 5+ component for rendering PDF
692 lines (685 loc) • 38 kB
JavaScript
import { __decorate } from 'tslib';
import { EventEmitter, ElementRef, ViewChild, Output, Input, HostListener, Component, NgModule } from '@angular/core';
import * as PDFJS from 'pdfjs-dist/es5/build/pdf';
import { VerbosityLevel, version, GlobalWorkerOptions, LinkTarget, getDocument } from 'pdfjs-dist/es5/build/pdf';
import * as PDFJSViewer from 'pdfjs-dist/es5/web/pdf_viewer';
import { PDFLinkService, PDFFindController, PDFViewer, PDFSinglePageViewer } from 'pdfjs-dist/es5/web/pdf_viewer';
function _createEventBus(pdfJsViewer) {
const globalEventBus = new pdfJsViewer.EventBus(true);
attachDOMEventsToEventBus(globalEventBus);
return globalEventBus;
}
function attachDOMEventsToEventBus(eventBus) {
eventBus.on('documentload', () => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('documentload', true, true, {});
window.dispatchEvent(event);
});
eventBus.on('pagerendered', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('pagerendered', true, true, {
pageNumber: evt.pageNumber,
cssTransform: evt.cssTransform
});
evt.source.div.dispatchEvent(event);
});
eventBus.on('textlayerrendered', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('textlayerrendered', true, true, {
pageNumber: evt.pageNumber
});
evt.source.textLayerDiv.dispatchEvent(event);
});
eventBus.on('pagechanging', evt => {
const event = document.createEvent('UIEvents');
event.initEvent('pagechanging', true, true);
/* tslint:disable:no-string-literal */
event['pageNumber'] = evt.pageNumber;
evt.source.container.dispatchEvent(event);
});
eventBus.on('pagesinit', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('pagesinit', true, true, null);
evt.source.container.dispatchEvent(event);
});
eventBus.on('pagesloaded', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('pagesloaded', true, true, {
pagesCount: evt.pagesCount
});
evt.source.container.dispatchEvent(event);
});
eventBus.on('scalechange', evt => {
const event = document.createEvent('UIEvents');
event.initEvent('scalechange', true, true);
/* tslint:disable:no-string-literal */
event['scale'] = evt.scale;
/* tslint:disable:no-string-literal */
event['presetValue'] = evt.presetValue;
evt.source.container.dispatchEvent(event);
});
eventBus.on('updateviewarea', evt => {
const event = document.createEvent('UIEvents');
event.initEvent('updateviewarea', true, true);
event['location'] = evt.location;
evt.source.container.dispatchEvent(event);
});
eventBus.on('find', evt => {
if (evt.source === window) {
return; // event comes from FirefoxCom, no need to replicate
}
const event = document.createEvent('CustomEvent');
event.initCustomEvent('find' + evt.type, true, true, {
query: evt.query,
phraseSearch: evt.phraseSearch,
caseSensitive: evt.caseSensitive,
highlightAll: evt.highlightAll,
findPrevious: evt.findPrevious
});
window.dispatchEvent(event);
});
eventBus.on('attachmentsloaded', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('attachmentsloaded', true, true, {
attachmentsCount: evt.attachmentsCount
});
evt.source.container.dispatchEvent(event);
});
eventBus.on('sidebarviewchanged', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('sidebarviewchanged', true, true, {
view: evt.view
});
evt.source.outerContainer.dispatchEvent(event);
});
eventBus.on('pagemode', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('pagemode', true, true, {
mode: evt.mode
});
evt.source.pdfViewer.container.dispatchEvent(event);
});
eventBus.on('namedaction', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('namedaction', true, true, {
action: evt.action
});
evt.source.pdfViewer.container.dispatchEvent(event);
});
eventBus.on('presentationmodechanged', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('presentationmodechanged', true, true, {
active: evt.active,
switchInProgress: evt.switchInProgress
});
window.dispatchEvent(event);
});
eventBus.on('outlineloaded', evt => {
const event = document.createEvent('CustomEvent');
event.initCustomEvent('outlineloaded', true, true, {
outlineCount: evt.outlineCount
});
evt.source.container.dispatchEvent(event);
});
}
const createEventBus = _createEventBus;
function assign(obj, prop, value) {
obj[prop] = value;
}
function isSSR() {
return typeof window === 'undefined';
}
var PdfViewerComponent_1;
if (!isSSR()) {
assign(PDFJS, "verbosity", VerbosityLevel.ERRORS);
}
var RenderTextMode;
(function (RenderTextMode) {
RenderTextMode[RenderTextMode["DISABLED"] = 0] = "DISABLED";
RenderTextMode[RenderTextMode["ENABLED"] = 1] = "ENABLED";
RenderTextMode[RenderTextMode["ENHANCED"] = 2] = "ENHANCED";
})(RenderTextMode || (RenderTextMode = {}));
let PdfViewerComponent = PdfViewerComponent_1 = class PdfViewerComponent {
constructor(element) {
this.element = element;
this.isVisible = false;
this._cMapsUrl = typeof PDFJS !== 'undefined'
? `https://unpkg.com/pdfjs-dist@${version}/cmaps/`
: null;
this._renderText = true;
this._renderTextMode = RenderTextMode.ENABLED;
this._stickToPage = false;
this._originalSize = true;
this._page = 1;
this._zoom = 1;
this._zoomScale = 'page-width';
this._rotation = 0;
this._showAll = true;
this._canAutoResize = true;
this._fitToPage = false;
this._externalLinkTarget = 'blank';
this._showBorders = false;
this.isInitialized = false;
this.afterLoadComplete = new EventEmitter();
this.pageRendered = new EventEmitter();
this.pageInitialized = new EventEmitter();
this.textLayerRendered = new EventEmitter();
this.onError = new EventEmitter();
this.onProgress = new EventEmitter();
this.pageChange = new EventEmitter(true);
if (isSSR()) {
return;
}
let pdfWorkerSrc;
if (window.hasOwnProperty('pdfWorkerSrc') &&
typeof window.pdfWorkerSrc === 'string' &&
window.pdfWorkerSrc) {
pdfWorkerSrc = window.pdfWorkerSrc;
}
else {
pdfWorkerSrc = `https://cdn.jsdelivr.net/npm/pdfjs-dist@${version}/es5/build/pdf.worker.js`;
}
assign(GlobalWorkerOptions, "workerSrc", pdfWorkerSrc);
}
set cMapsUrl(cMapsUrl) {
this._cMapsUrl = cMapsUrl;
}
set page(_page) {
_page = parseInt(_page, 10) || 1;
const originalPage = _page;
if (this._pdf) {
_page = this.getValidPageNumber(_page);
}
this._page = _page;
if (originalPage !== _page) {
this.pageChange.emit(_page);
}
}
set renderText(renderText) {
this._renderText = renderText;
}
set renderTextMode(renderTextMode) {
this._renderTextMode = renderTextMode;
}
set originalSize(originalSize) {
this._originalSize = originalSize;
}
set showAll(value) {
this._showAll = value;
}
set stickToPage(value) {
this._stickToPage = value;
}
set zoom(value) {
if (value <= 0) {
return;
}
this._zoom = value;
}
get zoom() {
return this._zoom;
}
set zoomScale(value) {
this._zoomScale = value;
}
get zoomScale() {
return this._zoomScale;
}
set rotation(value) {
if (!(typeof value === 'number' && value % 90 === 0)) {
console.warn('Invalid pages rotation angle.');
return;
}
this._rotation = value;
}
set externalLinkTarget(value) {
this._externalLinkTarget = value;
}
set autoresize(value) {
this._canAutoResize = Boolean(value);
}
set fitToPage(value) {
this._fitToPage = Boolean(value);
}
set showBorders(value) {
this._showBorders = Boolean(value);
}
static getLinkTarget(type) {
switch (type) {
case 'blank':
return LinkTarget.BLANK;
case 'none':
return LinkTarget.NONE;
case 'self':
return LinkTarget.SELF;
case 'parent':
return LinkTarget.PARENT;
case 'top':
return LinkTarget.TOP;
}
return null;
}
ngAfterViewChecked() {
if (this.isInitialized) {
return;
}
const offset = this.pdfViewerContainer.nativeElement.offsetParent;
if (this.isVisible === true && offset == null) {
this.isVisible = false;
return;
}
if (this.isVisible === false && offset != null) {
this.isVisible = true;
setTimeout(() => {
this.ngOnInit();
this.ngOnChanges({ src: this.src });
});
}
}
ngOnInit() {
if (!isSSR() && this.isVisible) {
this.isInitialized = true;
this.setupMultiPageViewer();
this.setupSinglePageViewer();
}
}
ngOnDestroy() {
this.clear();
}
onPageResize() {
if (!this._canAutoResize || !this._pdf) {
return;
}
if (this.resizeTimeout) {
clearTimeout(this.resizeTimeout);
}
this.resizeTimeout = setTimeout(() => {
this.updateSize();
}, 100);
}
get pdfLinkService() {
return this._showAll
? this.pdfMultiPageLinkService
: this.pdfSinglePageLinkService;
}
get pdfViewer() {
return this.getCurrentViewer();
}
get pdfFindController() {
return this._showAll
? this.pdfMultiPageFindController
: this.pdfSinglePageFindController;
}
ngOnChanges(changes) {
if (isSSR() || !this.isVisible) {
return;
}
if ('src' in changes) {
this.loadPDF();
}
else if (this._pdf) {
if ('renderText' in changes) {
this.getCurrentViewer().textLayerMode = this._renderText
? this._renderTextMode
: RenderTextMode.DISABLED;
this.resetPdfDocument();
}
else if ('showAll' in changes) {
this.resetPdfDocument();
}
if ('page' in changes) {
const { page } = changes;
if (page.currentValue === this._latestScrolledPage) {
return;
}
// New form of page changing: The viewer will now jump to the specified page when it is changed.
// This behavior is introduced by using the PDFSinglePageViewer
this.getCurrentViewer().scrollPageIntoView({ pageNumber: this._page });
}
this.update();
}
}
updateSize() {
const currentViewer = this.getCurrentViewer();
this._pdf
.getPage(currentViewer.currentPageNumber)
.then((page) => {
const rotation = this._rotation || page.rotate;
const viewportWidth = page.getViewport({
scale: this._zoom,
rotation
}).width * PdfViewerComponent_1.CSS_UNITS;
let scale = this._zoom;
let stickToPage = true;
// Scale the document when it shouldn't be in original size or doesn't fit into the viewport
if (!this._originalSize ||
(this._fitToPage &&
viewportWidth > this.pdfViewerContainer.nativeElement.clientWidth)) {
const viewPort = page.getViewport({ scale: 1, rotation });
scale = this.getScale(viewPort.width, viewPort.height);
stickToPage = !this._stickToPage;
}
currentViewer._setScale(scale, stickToPage);
});
}
clear() {
if (this.loadingTask && !this.loadingTask.destroyed) {
this.loadingTask.destroy();
}
if (this._pdf) {
this._pdf.destroy();
this._pdf = null;
this.pdfMultiPageViewer.setDocument(null);
this.pdfSinglePageViewer.setDocument(null);
this.pdfMultiPageLinkService.setDocument(null, null);
this.pdfSinglePageLinkService.setDocument(null, null);
this.pdfMultiPageFindController.setDocument(null);
this.pdfSinglePageFindController.setDocument(null);
}
}
getPDFLinkServiceConfig() {
const pdfLinkServiceConfig = {};
const linkTarget = PdfViewerComponent_1.getLinkTarget(this._externalLinkTarget);
if (linkTarget) {
pdfLinkServiceConfig.externalLinkTarget = linkTarget;
}
return pdfLinkServiceConfig;
}
setupMultiPageViewer() {
assign(PDFJS, "disableTextLayer", !this._renderText);
const eventBus = createEventBus(PDFJSViewer);
eventBus.on('pagerendered', e => {
this.pageRendered.emit(e);
});
eventBus.on('pagesinit', e => {
this.pageInitialized.emit(e);
});
eventBus.on('pagechanging', e => {
if (this.pageScrollTimeout) {
clearTimeout(this.pageScrollTimeout);
}
this.pageScrollTimeout = setTimeout(() => {
this._latestScrolledPage = e.pageNumber;
this.pageChange.emit(e.pageNumber);
}, 100);
});
eventBus.on('textlayerrendered', e => {
this.textLayerRendered.emit(e);
});
this.pdfMultiPageLinkService = new PDFLinkService(Object.assign({ eventBus }, this.getPDFLinkServiceConfig()));
this.pdfMultiPageFindController = new PDFFindController({
linkService: this.pdfMultiPageLinkService,
eventBus
});
const pdfOptions = {
eventBus,
container: this.element.nativeElement.querySelector('div'),
removePageBorders: !this._showBorders,
linkService: this.pdfMultiPageLinkService,
textLayerMode: this._renderText
? this._renderTextMode
: RenderTextMode.DISABLED,
findController: this.pdfMultiPageFindController
};
this.pdfMultiPageViewer = new PDFViewer(pdfOptions);
this.pdfMultiPageLinkService.setViewer(this.pdfMultiPageViewer);
this.pdfMultiPageFindController.setDocument(this._pdf);
}
setupSinglePageViewer() {
assign(PDFJS, "disableTextLayer", !this._renderText);
const eventBus = createEventBus(PDFJSViewer);
eventBus.on('pagechanging', e => {
if (e.pageNumber !== this._page) {
this.page = e.pageNumber;
}
});
eventBus.on('pagerendered', e => {
this.pageRendered.emit(e);
});
eventBus.on('pagesinit', e => {
this.pageInitialized.emit(e);
});
eventBus.on('textlayerrendered', e => {
this.textLayerRendered.emit(e);
});
this.pdfSinglePageLinkService = new PDFLinkService(Object.assign({ eventBus }, this.getPDFLinkServiceConfig()));
this.pdfSinglePageFindController = new PDFFindController({
linkService: this.pdfSinglePageLinkService,
eventBus
});
const pdfOptions = {
eventBus,
container: this.element.nativeElement.querySelector('div'),
removePageBorders: !this._showBorders,
linkService: this.pdfSinglePageLinkService,
textLayerMode: this._renderText
? this._renderTextMode
: RenderTextMode.DISABLED,
findController: this.pdfSinglePageFindController
};
this.pdfSinglePageViewer = new PDFSinglePageViewer(pdfOptions);
this.pdfSinglePageLinkService.setViewer(this.pdfSinglePageViewer);
this.pdfSinglePageFindController.setDocument(this._pdf);
this.pdfSinglePageViewer._currentPageNumber = this._page;
}
getValidPageNumber(page) {
if (page < 1) {
return 1;
}
if (page > this._pdf.numPages) {
return this._pdf.numPages;
}
return page;
}
getDocumentParams() {
const srcType = typeof this.src;
if (!this._cMapsUrl) {
return this.src;
}
const params = {
cMapUrl: this._cMapsUrl,
cMapPacked: true
};
if (srcType === 'string') {
params.url = this.src;
}
else if (srcType === 'object') {
if (this.src.byteLength !== undefined) {
params.data = this.src;
}
else {
Object.assign(params, this.src);
}
}
return params;
}
loadPDF() {
if (!this.src) {
return;
}
if (this.lastLoaded === this.src) {
this.update();
return;
}
this.clear();
this.loadingTask = getDocument(this.getDocumentParams());
this.loadingTask.onProgress = (progressData) => {
this.onProgress.emit(progressData);
};
const src = this.src;
this.loadingTask.promise.then((pdf) => {
this._pdf = pdf;
this.lastLoaded = src;
this.afterLoadComplete.emit(pdf);
if (!this.pdfMultiPageViewer) {
this.setupMultiPageViewer();
this.setupSinglePageViewer();
}
this.resetPdfDocument();
this.update();
}, (error) => {
this.onError.emit(error);
});
}
update() {
this.page = this._page;
this.render();
}
render() {
this._page = this.getValidPageNumber(this._page);
const currentViewer = this.getCurrentViewer();
if (this._rotation !== 0 ||
currentViewer.pagesRotation !== this._rotation) {
setTimeout(() => {
currentViewer.pagesRotation = this._rotation;
});
}
if (this._stickToPage) {
setTimeout(() => {
currentViewer.currentPageNumber = this._page;
});
}
this.updateSize();
}
getScale(viewportWidth, viewportHeight) {
const borderSize = (this._showBorders ? 2 * PdfViewerComponent_1.BORDER_WIDTH : 0);
const pdfContainerWidth = this.pdfViewerContainer.nativeElement.clientWidth - borderSize;
const pdfContainerHeight = this.pdfViewerContainer.nativeElement.clientHeight - borderSize;
if (pdfContainerHeight === 0 || viewportHeight === 0 || pdfContainerWidth === 0 || viewportWidth === 0) {
return 1;
}
let ratio = 1;
switch (this._zoomScale) {
case 'page-fit':
ratio = Math.min((pdfContainerHeight / viewportHeight), (pdfContainerWidth / viewportWidth));
break;
case 'page-height':
ratio = (pdfContainerHeight / viewportHeight);
break;
case 'page-width':
default:
ratio = (pdfContainerWidth / viewportWidth);
break;
}
return (this._zoom * ratio) / PdfViewerComponent_1.CSS_UNITS;
}
getCurrentViewer() {
return this._showAll ? this.pdfMultiPageViewer : this.pdfSinglePageViewer;
}
resetPdfDocument() {
this.pdfFindController.setDocument(this._pdf);
if (this._showAll) {
this.pdfSinglePageViewer.setDocument(null);
this.pdfSinglePageLinkService.setDocument(null);
this.pdfMultiPageViewer.setDocument(this._pdf);
this.pdfMultiPageLinkService.setDocument(this._pdf, null);
}
else {
this.pdfMultiPageViewer.setDocument(null);
this.pdfMultiPageLinkService.setDocument(null);
this.pdfSinglePageViewer.setDocument(this._pdf);
this.pdfSinglePageLinkService.setDocument(this._pdf, null);
}
}
};
PdfViewerComponent.CSS_UNITS = 96.0 / 72.0;
PdfViewerComponent.BORDER_WIDTH = 9;
PdfViewerComponent.ctorParameters = () => [
{ type: ElementRef }
];
__decorate([
ViewChild('pdfViewerContainer')
], PdfViewerComponent.prototype, "pdfViewerContainer", void 0);
__decorate([
Output('after-load-complete')
], PdfViewerComponent.prototype, "afterLoadComplete", void 0);
__decorate([
Output('page-rendered')
], PdfViewerComponent.prototype, "pageRendered", void 0);
__decorate([
Output('pages-initialized')
], PdfViewerComponent.prototype, "pageInitialized", void 0);
__decorate([
Output('text-layer-rendered')
], PdfViewerComponent.prototype, "textLayerRendered", void 0);
__decorate([
Output('error')
], PdfViewerComponent.prototype, "onError", void 0);
__decorate([
Output('on-progress')
], PdfViewerComponent.prototype, "onProgress", void 0);
__decorate([
Output()
], PdfViewerComponent.prototype, "pageChange", void 0);
__decorate([
Input()
], PdfViewerComponent.prototype, "src", void 0);
__decorate([
Input('c-maps-url')
], PdfViewerComponent.prototype, "cMapsUrl", null);
__decorate([
Input('page')
], PdfViewerComponent.prototype, "page", null);
__decorate([
Input('render-text')
], PdfViewerComponent.prototype, "renderText", null);
__decorate([
Input('render-text-mode')
], PdfViewerComponent.prototype, "renderTextMode", null);
__decorate([
Input('original-size')
], PdfViewerComponent.prototype, "originalSize", null);
__decorate([
Input('show-all')
], PdfViewerComponent.prototype, "showAll", null);
__decorate([
Input('stick-to-page')
], PdfViewerComponent.prototype, "stickToPage", null);
__decorate([
Input('zoom')
], PdfViewerComponent.prototype, "zoom", null);
__decorate([
Input('zoom-scale')
], PdfViewerComponent.prototype, "zoomScale", null);
__decorate([
Input('rotation')
], PdfViewerComponent.prototype, "rotation", null);
__decorate([
Input('external-link-target')
], PdfViewerComponent.prototype, "externalLinkTarget", null);
__decorate([
Input('autoresize')
], PdfViewerComponent.prototype, "autoresize", null);
__decorate([
Input('fit-to-page')
], PdfViewerComponent.prototype, "fitToPage", null);
__decorate([
Input('show-borders')
], PdfViewerComponent.prototype, "showBorders", null);
__decorate([
HostListener('window:resize', [])
], PdfViewerComponent.prototype, "onPageResize", null);
PdfViewerComponent = PdfViewerComponent_1 = __decorate([
Component({
selector: 'pdf-viewer',
template: `
<div #pdfViewerContainer class="ng2-pdf-viewer-container">
<div class="pdfViewer"></div>
</div>
`,
styles: [".ng2-pdf-viewer-container{overflow-x:auto;position:relative;height:100%;-webkit-overflow-scrolling:touch}:host ::ng-deep .textLayer{position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;opacity:.2;line-height:1}:host ::ng-deep .textLayer>span{color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0 0}:host ::ng-deep .textLayer .highlight{margin:-1px;padding:1px;background-color:#b400aa;border-radius:4px}:host ::ng-deep .textLayer .highlight.begin{border-radius:4px 0 0 4px}:host ::ng-deep .textLayer .highlight.end{border-radius:0 4px 4px 0}:host ::ng-deep .textLayer .highlight.middle{border-radius:0}:host ::ng-deep .textLayer .highlight.selected{background-color:#006400}:host ::ng-deep .textLayer ::-moz-selection{background:#00f}:host ::ng-deep .textLayer ::selection{background:#00f}:host ::ng-deep .textLayer .endOfContent{display:block;position:absolute;left:0;top:100%;right:0;bottom:0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host ::ng-deep .textLayer .endOfContent.active{top:0}:host ::ng-deep .annotationLayer section{position:absolute}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.pushButton>a,:host ::ng-deep .annotationLayer .linkAnnotation>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.pushButton>a:hover,:host ::ng-deep .annotationLayer .linkAnnotation>a:hover{opacity:.2;background:#ff0;box-shadow:0 2px 10px #ff0}:host ::ng-deep .annotationLayer .textAnnotation img{position:absolute;cursor:pointer}:host ::ng-deep .annotationLayer .textWidgetAnnotation input,:host ::ng-deep .annotationLayer .textWidgetAnnotation textarea{background-color:rgba(0,54,255,.13);border:1px solid transparent;box-sizing:border-box;font-size:9px;height:100%;margin:0;padding:0 3px;vertical-align:top;width:100%}:host ::ng-deep .annotationLayer .choiceWidgetAnnotation select{background-color:rgba(0,54,255,.13);border:1px solid transparent;box-sizing:border-box;font-size:9px;height:100%;margin:0;padding:0 3px;vertical-align:top;width:100%}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.checkBox input,:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.radioButton input{background-color:rgba(0,54,255,.13);border:1px solid transparent;box-sizing:border-box;font-size:9px;height:100%;margin:0;vertical-align:top;width:100%}:host ::ng-deep .annotationLayer .choiceWidgetAnnotation select option{padding:0}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}:host ::ng-deep .annotationLayer .textWidgetAnnotation textarea{font:message-box;font-size:9px;resize:none}:host ::ng-deep .annotationLayer .textWidgetAnnotation input[disabled],:host ::ng-deep .annotationLayer .textWidgetAnnotation textarea[disabled]{background:0 0;border:1px solid transparent;cursor:not-allowed}:host ::ng-deep .annotationLayer .choiceWidgetAnnotation select[disabled]{background:0 0;border:1px solid transparent;cursor:not-allowed}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled]{background:0 0;border:1px solid transparent;cursor:not-allowed}:host ::ng-deep .annotationLayer .textWidgetAnnotation input:hover,:host ::ng-deep .annotationLayer .textWidgetAnnotation textarea:hover{border:1px solid #000}:host ::ng-deep .annotationLayer .choiceWidgetAnnotation select:hover{border:1px solid #000}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.checkBox input:hover,:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.radioButton input:hover{border:1px solid #000}:host ::ng-deep .annotationLayer .textWidgetAnnotation input:focus,:host ::ng-deep .annotationLayer .textWidgetAnnotation textarea:focus{background:0 0;border:1px solid transparent}:host ::ng-deep .annotationLayer .choiceWidgetAnnotation select:focus{background:0 0;border:1px solid transparent}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{background-color:#000;content:\"\";display:block;position:absolute;height:80%;left:45%;width:1px}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:#000;content:\"\";display:block;position:absolute;border-radius:50%;height:50%;left:30%;top:20%;width:50%}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}:host ::ng-deep .annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}:host ::ng-deep .annotationLayer .textWidgetAnnotation input.comb:focus{width:115%}:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.checkBox input,:host ::ng-deep .annotationLayer .buttonWidgetAnnotation.radioButton input{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0}:host ::ng-deep .annotationLayer .popupWrapper{position:absolute;width:20em}:host ::ng-deep .annotationLayer .popup{position:absolute;z-index:200;max-width:20em;background-color:#ff9;box-shadow:0 2px 5px #888;border-radius:2px;padding:6px;margin-left:5px;cursor:pointer;font:message-box;font-size:9px;word-wrap:break-word}:host ::ng-deep .annotationLayer .popup>*{font-size:9px}:host ::ng-deep .annotationLayer .popup h1{display:inline-block}:host ::ng-deep .annotationLayer .popup span{display:inline-block;margin-left:5px}:host ::ng-deep .annotationLayer .popup p{border-top:1px solid #333;margin-top:2px;padding-top:2px}:host ::ng-deep .annotationLayer .caretAnnotation,:host ::ng-deep .annotationLayer .circleAnnotation svg ellipse,:host ::ng-deep .annotationLayer .fileAttachmentAnnotation,:host ::ng-deep .annotationLayer .freeTextAnnotation,:host ::ng-deep .annotationLayer .highlightAnnotation,:host ::ng-deep .annotationLayer .inkAnnotation svg polyline,:host ::ng-deep .annotationLayer .lineAnnotation svg line,:host ::ng-deep .annotationLayer .polygonAnnotation svg polygon,:host ::ng-deep .annotationLayer .polylineAnnotation svg polyline,:host ::ng-deep .annotationLayer .squareAnnotation svg rect,:host ::ng-deep .annotationLayer .squigglyAnnotation,:host ::ng-deep .annotationLayer .stampAnnotation,:host ::ng-deep .annotationLayer .strikeoutAnnotation,:host ::ng-deep .annotationLayer .underlineAnnotation{cursor:pointer}:host ::ng-deep .pdfViewer{padding-bottom:10px}:host ::ng-deep .pdfViewer .canvasWrapper{overflow:hidden}:host ::ng-deep .pdfViewer .page{direction:ltr;width:816px;height:1056px;margin:1px auto -8px;position:relative;overflow:visible;border:9px solid rgba(0,0,0,.01);box-sizing:initial;background-clip:content-box;-o-border-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAA6UlEQVR4Xl2Pi2rEMAwE16fm1f7/r14v7w4rI0IzLAF7hLxNevBSEMEF5+OilNCsRd8ZMyn+a4NmsOT8WJw1lFbSYgGFzF2bLFoLjTClWjKKGRWpDYAGXUnZ4uhbBUzF3Oe/GG/ue2fn4GgsyXhNgysV2JnrhKEMg4fEZcALmiKbNhBBRFpSyDOj1G4QOVly6O1FV54ZZq8OVygrciDt6JazRgi1ljTPH0gbrPmHPXAbCiDd4GawIjip1TPh9tt2sz24qaCjr/jAb/GBFTbq9KZ7Ke/Cqt8nayUikZKsWZK7Fe6bg5dOUt8fZHWG2BHc+6EAAAAASUVORK5CYII=) 9 9 repeat;border-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAA6UlEQVR4Xl2Pi2rEMAwE16fm1f7/r14v7w4rI0IzLAF7hLxNevBSEMEF5+OilNCsRd8ZMyn+a4NmsOT8WJw1lFbSYgGFzF2bLFoLjTClWjKKGRWpDYAGXUnZ4uhbBUzF3Oe/GG/ue2fn4GgsyXhNgysV2JnrhKEMg4fEZcALmiKbNhBBRFpSyDOj1G4QOVly6O1FV54ZZq8OVygrciDt6JazRgi1ljTPH0gbrPmHPXAbCiDd4GawIjip1TPh9tt2sz24qaCjr/jAb/GBFTbq9KZ7Ke/Cqt8nayUikZKsWZK7Fe6bg5dOUt8fZHWG2BHc+6EAAAAASUVORK5CYII=) 9 9 repeat;background-color:#fff}:host ::ng-deep .pdfViewer.removePageBorders .page{margin:0 auto 10px;border:none}:host ::ng-deep .pdfViewer.removePageBorders{padding-bottom:0}:host ::ng-deep .pdfViewer.singlePageView{display:inline-block}:host ::ng-deep .pdfViewer.singlePageView .page{margin:0;border:none}:host ::ng-deep .pdfViewer.scrollHorizontal,:host ::ng-deep .pdfViewer.scrollWrapped{margin-left:3.5px;margin-right:3.5px;text-align:center}:host ::ng-deep .spread{margin-left:3.5px;margin-right:3.5px;text-align:center}:host ::ng-deep .pdfViewer.scrollHorizontal,:host ::ng-deep .spread{white-space:nowrap}:host ::ng-deep .pdfViewer.removePageBorders,:host ::ng-deep .pdfViewer.scrollHorizontal .spread,:host ::ng-deep .pdfViewer.scrollWrapped .spread{margin-left:0;margin-right:0}:host ::ng-deep .spread .page{display:inline-block;vertical-align:middle;margin-left:-3.5px;margin-right:-3.5px}:host ::ng-deep .pdfViewer.scrollHorizontal .page,:host ::ng-deep .pdfViewer.scrollHorizontal .spread,:host ::ng-deep .pdfViewer.scrollWrapped .page,:host ::ng-deep .pdfViewer.scrollWrapped .spread{display:inline-block;vertical-align:middle}:host ::ng-deep .pdfViewer.scrollHorizontal .page,:host ::ng-deep .pdfViewer.scrollWrapped .page{margin-left:-3.5px;margin-right:-3.5px}:host ::ng-deep .pdfViewer.removePageBorders .spread .page,:host ::ng-deep .pdfViewer.removePageBorders.scrollHorizontal .page,:host ::ng-deep .pdfViewer.removePageBorders.scrollWrapped .page{margin-left:5px;margin-right:5px}:host ::ng-deep .pdfViewer .page canvas{margin:0;display:block}:host ::ng-deep .pdfViewer .page canvas[hidden]{display:none}:host ::ng-deep .pdfViewer .page .loadingIcon{position:absolute;display:block;left:0;top:0;right:0;bottom:0;background:url(data:image/gif;base64,R0lGODlhGAAYAPQAAP///wAAAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQJBwAAACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIh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ck8oC0DQqBQGGIz+t3eXtob0ZTPgNrIwQJDgtGAgwCWSIMDg4HiiUIDAxFAAoODwxDBWINCEGdSTQkCQcoegADBaQ6MggHjwAFBZUFCm0HB0kJCUy9bAYHCCPGIwqmRq0jySMGmj6yRiEAIfkECQcAAAAsAAAAABgAGAAABbIgII4k0DRlmg6kYZCsOg4EKhLE2BCxDOAxnIiW84l2L4BLZKipBopW8XRLDkeCiAMyMvQAA+uON4JEIo+vqukkKQ6RhLHplVGN+LyKcXA4Dgx5DWwGDXx+gIKENnqNdzIDaiMECwcFRgQCCowiCAcHCZIlCgICVgSfCEMMnA0CXaU2YSQFoQAKUQMMqjoyAglcAAyBAAIMRUYLCUkFlybDeAYJryLNk6xGNCTQXY0juHghACH5BAkHAAAALAAAAAAYABgAAAWzICCOJNA0ZVoOAmkY5KCSSgSNBDE2hDyLjohClBMNij8RJHIQvZwEVOpIekRQJyJs5AMoHA+GMbE1lnm9EcPhOHRnhpwUl3AsknHDm5RN+v8qCAkHBwkIfw1xBAYNgoSGiIqMgJQifZUjBhAJYj95ewIJCQV7KYpzBAkLLQADCHOtOpY5PgNlAAykAEUsQ1wzCgWdCIdeArczBQVbDJ0NAqyeBb64nQAGArBTt8R8mLuyPyEAOwAAAAAAAAAAAA==) center no-repeat}:host ::ng-deep .pdfPresentationMode .pdfViewer{margin-left:0;margin-right:0}:host ::ng-deep .pdfPresentationMode .pdfViewer .page,:host ::ng-deep .pdfPresentationMode .pdfViewer .spread{display:block}:host ::ng-deep .pdfPresentationMode .pdfViewer .page,:host ::ng-deep .pdfPresentationMode .pdfViewer.removePageBorders .page{margin-left:auto;margin-right:auto}:host ::ng-deep .pdfPresentationMode:-ms-fullscreen .pdfViewer .page{margin-bottom:100%!important}:host ::ng-deep .pdfPresentationMode:-webkit-full-screen .pdfViewer .page{margin-bottom:100%;border:0}:host ::ng-deep .pdfPresentationMode:-moz-full-screen .pdfViewer .page,:host ::ng-deep .pdfPresentationMode:-webkit-full-screen .pdfViewer .page,:host ::ng-deep .pdfPresentationMode:fullscreen .pdfViewer .page{margin-bottom:100%;border:0}"]
})
], PdfViewerComponent);
let PdfViewerModule = class PdfViewerModule {
};
PdfViewerModule = __decorate([
NgModule({
declarations: [PdfViewerComponent],
exports: [PdfViewerComponent]
})
], PdfViewerModule);
/**
* Generated bundle index. Do not edit.
*/
export { PdfViewerComponent, PdfViewerModule, RenderTextMode };
//# sourceMappingURL=amaplex-software-ng2-pdf-viewer.js.map