ngx-extended-pdf-viewer
Version:
Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.
33 lines • 7.54 kB
JavaScript
import { Component, Input, effect } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../../pdf-notification-service";
import * as i2 from "../pdf-shy-button/pdf-shy-button.component";
import * as i3 from "../../responsive-visibility";
export class PdfMoveDownComponent {
notificationService;
showMoveDownButton = true;
PDFViewerApplication;
constructor(notificationService) {
this.notificationService = notificationService;
effect(() => {
this.PDFViewerApplication = notificationService.onPDFJSInitSignal();
});
}
movePageDown = () => {
if (this.PDFViewerApplication) {
const currentPage = this.PDFViewerApplication.page;
this.PDFViewerApplication.eventBus.dispatch('movePageDown', {
source: { pageNumber: currentPage }
});
}
};
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PdfMoveDownComponent, deps: [{ token: i1.PDFNotificationService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PdfMoveDownComponent, selector: "pdf-move-down", inputs: { showMoveDownButton: "showMoveDownButton" }, ngImport: i0, template: "<pdf-shy-button\n primaryToolbarId=\"primaryMoveDownButton\"\n secondaryMenuId=\"secondaryMoveDownButton\"\n [cssClass]=\"showMoveDownButton | responsiveCSSClass: 'hiddenSmallView'\"\n title=\"Move Page Down\"\n l10nLabel=\"pdfjs-editor-movePageDown-button-label\"\n [action]=\"movePageDown\"\n image=\"<svg viewBox='0 0 24 24' height='20px' width='24px' aria-hidden='true'><path d='M14 2l6 6v7a2 2 0 0 1-2 2v-3H6v3a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8m4 12v-5h-5v-5H6v10h12z' fill='currentColor'></path><path d='M6 16h12' stroke-dasharray='3,2' stroke-width='2' stroke='currentColor' fill='none'></path><path d='M12 23l-4-4h8l-4 4z' fill='currentColor'></path></svg>\"\n [order]=\"450\"\n>\n</pdf-shy-button>\n", styles: [":host{margin-top:0}:host:focus{outline:none}button:focus{outline:none}svg:focus{outline:none}button{padding:0}\n"], dependencies: [{ kind: "component", type: i2.PdfShyButtonComponent, selector: "pdf-shy-button", inputs: ["primaryToolbarId", "secondaryMenuId", "cssClass", "eventBusName", "l10nId", "l10nLabel", "title", "toggled", "disabled", "order", "action", "closeOnClick", "onlySecondaryMenu", "image"] }, { kind: "pipe", type: i3.ResponsiveCSSClassPipe, name: "responsiveCSSClass" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PdfMoveDownComponent, decorators: [{
type: Component,
args: [{ selector: 'pdf-move-down', template: "<pdf-shy-button\n primaryToolbarId=\"primaryMoveDownButton\"\n secondaryMenuId=\"secondaryMoveDownButton\"\n [cssClass]=\"showMoveDownButton | responsiveCSSClass: 'hiddenSmallView'\"\n title=\"Move Page Down\"\n l10nLabel=\"pdfjs-editor-movePageDown-button-label\"\n [action]=\"movePageDown\"\n image=\"<svg viewBox='0 0 24 24' height='20px' width='24px' aria-hidden='true'><path d='M14 2l6 6v7a2 2 0 0 1-2 2v-3H6v3a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8m4 12v-5h-5v-5H6v10h12z' fill='currentColor'></path><path d='M6 16h12' stroke-dasharray='3,2' stroke-width='2' stroke='currentColor' fill='none'></path><path d='M12 23l-4-4h8l-4 4z' fill='currentColor'></path></svg>\"\n [order]=\"450\"\n>\n</pdf-shy-button>\n", styles: [":host{margin-top:0}:host:focus{outline:none}button:focus{outline:none}svg:focus{outline:none}button{padding:0}\n"] }]
}], ctorParameters: () => [{ type: i1.PDFNotificationService }], propDecorators: { showMoveDownButton: [{
type: Input
}] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGRmLW1vdmUtZG93bi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uL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