import { PlatformLocation } from '@angular/common'; import { ChangeDetectorRef, ElementRef, InputSignal, ModelSignal, NgZone, OnDestroy, OnInit, Renderer2, TemplateRef } from '@angular/core'; import { FindResultMatchesCount, FindState } from './events/find-result'; import { PageRenderEvent } from './events/page-render-event'; import { PageRenderedEvent } from './events/page-rendered-event'; import { PagesLoadedEvent } from './events/pages-loaded-event'; import { PdfDownloadedEvent } from './events/pdf-downloaded-event'; import { PdfLoadedEvent } from './events/pdf-loaded-event'; import { PdfLoadingStartsEvent } from './events/pdf-loading-starts-event'; import { PdfThumbnailDrawnEvent } from './events/pdf-thumbnail-drawn-event'; import { ProgressBarEvent } from './events/progress-bar-event'; import { TextLayerRenderedEvent } from './events/textlayer-rendered'; import { NgxExtendedPdfViewerService } from './ngx-extended-pdf-viewer.service'; import { PageViewModeType, ScrollModeType } from './options/pdf-viewer'; import { PDFDocumentProxy } from './options/pdf-viewer-application'; import { VerbosityLevel } from './options/verbosity-level'; import { PdfDummyComponentsComponent } from './pdf-dummy-components/pdf-dummy-components.component'; import { PDFNotificationService } from './pdf-notification-service'; import { IOSCanvasOptimizationService } from './services/ios-canvas-optimization.service'; import { AnnotationEditorEvent } from './events/annotation-editor-layer-event'; import { AnnotationEditorLayerRenderedEvent } from './events/annotation-editor-layer-rendered-event'; import { AnnotationEditorEditorModeChangedEvent } from './events/annotation-editor-mode-changed-event'; import { AnnotationLayerRenderedEvent } from './events/annotation-layer-rendered-event'; import { LinkAnnotationsAddedEvent } from './events/link-annotations-added-event'; import { AttachmentLoadedEvent } from './events/attachment-loaded-event'; import { LayersLoadedEvent } from './events/layers-loaded-event'; import { OutlineLoadedEvent } from './events/outline-loaded-event'; import { XfaLayerRenderedEvent } from './events/xfa-layer-rendered-event'; import { NgxHasHeight } from './ngx-has-height'; import { NgxKeyboardManagerService } from './ngx-keyboard-manager.service'; import { PdfSidebarView } from './options/pdf-sidebar-views'; import { SpreadType } from './options/spread-type'; import { ZoomType } from './options/zoom-type'; import { PdfCspPolicyService } from './pdf-csp-policy.service'; import { PDFScriptLoaderService } from './pdf-script-loader.service'; import { ResponsiveVisibility } from './responsive-visibility'; import * as i0 from "@angular/core"; export interface FormDataType { [fieldName: string]: null | string | number | boolean | string[]; } export type PdfSrcType = string | ArrayBuffer | Blob | Uint8Array | URL | { range: any; } | undefined; export type Base64SrcType = (string | null | undefined) & {}; export type PageType = (number | undefined) & {}; export type NamedDestType = (string | undefined) & {}; export type PasswordType = (string | undefined) & {}; export declare function isIOS(): boolean; export declare class NgxExtendedPdfViewerComponent implements OnInit, OnDestroy, NgxHasHeight { private readonly platformId; private readonly notificationService; private readonly elementRef; private readonly platformLocation; cdr: ChangeDetectorRef; service: NgxExtendedPdfViewerService; private readonly renderer; private readonly pdfScriptLoaderService; private readonly keyboardManager; private readonly cspPolicyService; private readonly iosCanvasService; private readonly ngZone; private readonly formSupport; /** #3131 AbortController to unregister all eventBus listeners on destroy. */ private eventBusAbortController; /** * The dummy components are inserted automatically when the user customizes the toolbar * without adding every original toolbar item. Without the dummy components, the * initialization code of pdf.js crashes because it assume that every standard widget is there. */ dummyComponents: import("@angular/core").Signal; root: import("@angular/core").Signal>; annotationEditorEvent: import("@angular/core").OutputEmitterRef; customFindbarInputArea: InputSignal | undefined>; customToolbar: InputSignal | undefined>; customFindbar: InputSignal | undefined>; customFindbarButtons: InputSignal | undefined>; customPdfViewer: InputSignal | undefined>; customSecondaryToolbar: InputSignal | undefined>; customSidebar: InputSignal | undefined>; customThumbnail: InputSignal | undefined>; customFreeFloatingBar: InputSignal | undefined>; showFreeFloatingBar: InputSignal; enableDragAndDrop: InputSignal; forceUsingLegacyES5: InputSignal; localizationInitialized: boolean; private resizeObserver; private initialAngularFormData?; formData: InputSignal; private _formDataEffect; disableForms: InputSignal; get formDataChange(): import("@angular/core").EventEmitter; baseHref: string; /** This flag prevents trying to load a file twice if the user uploads it using the file upload dialog or via drag'n'drop */ private srcChangeTriggeredByUser; pageViewMode: ModelSignal; private _previousPageViewMode; private _pageViewModeEffect; private handleViewMode; private handleInfiniteScrollMode; private handleSinglePageMode; private handleBookMode; private handleMultiplePageMode; private redrawViewer; markForCheck(): void; progress: import("@angular/core").OutputEmitterRef; private readonly secondaryToolbarComponent; private readonly dynamicCSSComponent; private readonly sidebarComponent; src: ModelSignal; private _srcEffect; private _src; /** #3131 Tracks the last _src value that was actually opened, to avoid redundant re-opens when the effect re-fires. */ private _lastOpenedSrc; scrollMode: ModelSignal; private _scrollModeEffect; authorization: InputSignal; httpHeaders: InputSignal; contextMenuAllowed: InputSignal; afterPrint: import("@angular/core").OutputEmitterRef; beforePrint: import("@angular/core").OutputEmitterRef; currentZoomFactor: import("@angular/core").OutputEmitterRef; /** This field stores the previous zoom level if the page is enlarged with a double-tap or double-click */ private previousZoom; enablePrint: InputSignal; enablePrintAutoRotate: InputSignal; private _enablePrintAutoRotateEffect; /** Force reloading of the JavaScript code. Useful for testing and micro-frontends */ forceFullReloadOfJavaScriptCode: InputSignal; showEditorButtons: InputSignal; disableEditorButtons: InputSignal; showTextEditor: InputSignal; disableTextEditor: InputSignal; showStampEditor: InputSignal; disableStampEditor: InputSignal; showCommentEditor: InputSignal; disableCommentEditor: InputSignal; showDrawEditor: InputSignal; disableDrawEditor: InputSignal; showHighlightEditor: InputSignal; disableHighlightEditor: InputSignal; showSignatureEditor: InputSignal; disableSignatureEditor: InputSignal; effectiveShowTextEditor: import("@angular/core").Signal; effectiveShowStampEditor: import("@angular/core").Signal; effectiveShowCommentEditor: import("@angular/core").Signal; effectiveShowDrawEditor: import("@angular/core").Signal; effectiveShowHighlightEditor: import("@angular/core").Signal; effectiveShowSignatureEditor: import("@angular/core").Signal; /** How many log messages should be printed? * Legal values: VerbosityLevel.INFOS (= 5), VerbosityLevel.WARNINGS (= 1), VerbosityLevel.ERRORS (= 0) */ logLevel: InputSignal; /** Use the minified (minifiedJSLibraries="true", which is the default) or the user-readable pdf.js library (minifiedJSLibraries="false") */ minifiedJSLibraries: ModelSignal; private _minifiedJSLibrariesEffect; primaryMenuVisible: boolean; /** option to increase (or reduce) print resolution. Default is 150 (dpi). Sensible values * are 300, 600, and 1200. Note the increase memory consumption, which may even result in a browser crash. */ printResolution: InputSignal; rotation: ModelSignal<0 | 90 | 180 | 270>; annotationLayerRendered: import("@angular/core").OutputEmitterRef; linkAnnotationsAdded: import("@angular/core").OutputEmitterRef; annotationEditorLayerRendered: import("@angular/core").OutputEmitterRef; xfaLayerRendered: import("@angular/core").OutputEmitterRef; outlineLoaded: import("@angular/core").OutputEmitterRef; attachmentsloaded: import("@angular/core").OutputEmitterRef; layersloaded: import("@angular/core").OutputEmitterRef; hasSignature: boolean; private convertBlobToUint8Array; base64Src: InputSignal; private base64SrcEffect; /** * The combination of height, minHeight, and autoHeight ensures the PDF height of the PDF viewer is calculated correctly when the height is a percentage. * By default, many CSS frameworks make a div with 100% have a height or zero pixels. checkHeight() fixes this. */ autoHeight: boolean; protected _minHeight?: string; protected _height: string | undefined; get minHeight(): string | undefined; set minHeight(value: string | undefined); get height(): string | undefined; set height(value: string | undefined); minHeightInput: InputSignal; heightInput: InputSignal; private _heightEffect; backgroundColor: InputSignal; pdfBackgroundColor: InputSignal; private _pdfBackgroundColorEffect; private _readingDirectionEffect; /** Allows the user to define the name of the file after clicking "download" */ filenameForDownload: InputSignal; /** Allows the user to disable the keyboard bindings completely */ ignoreKeyboard: InputSignal; /** Allows the user to disable a list of key bindings. */ ignoreKeys: InputSignal; /** Allows the user to enable a list of key bindings explicitly. If this property is set, every other key binding is ignored. */ acceptKeys: InputSignal; hasTextLayer: boolean; /** Allows the user to put the viewer's svg images into an arbitrary folder */ imageResourcesPath: InputSignal; /** Allows the user to put their locale folder into an arbitrary folder */ localeFolderPath: InputSignal; /** Override the default locale. This must be the complete locale name, such as "es-ES". The string is allowed to be all lowercase. */ language: InputSignal; /** By default, listening to the URL is deactivated because often the anchor tag is used for the Angular router */ listenToURL: InputSignal; /** Navigate to a certain "named destination" */ nameddest: InputSignal; /** allows you to pass a password to read password-protected files */ password: InputSignal; replaceBrowserPrint: InputSignal; private readonly originalPrint; /** Store the original color-scheme value to restore it on destroy */ private originalColorScheme; useInlineScripts: InputSignal; viewerPositionTop: string; /** pdf.js can show signatures, but fails to verify them. So they are switched off by default. * Set "[showUnverifiedSignatures]"="true" to display e-signatures nonetheless. */ showUnverifiedSignatures: InputSignal; startTabindex: InputSignal; showSidebarButton: InputSignal; disableSidebarButton: InputSignal; private _showSidebarButtonEffect; _showSidebarButton: ResponsiveVisibility; sidebarVisible: ModelSignal; private _sidebarVisibleEffect; activeSidebarView: ModelSignal; findbarVisible: ModelSignal; propertiesDialogVisible: ModelSignal; showFindButton: InputSignal; disableFindButton: InputSignal; showFindHighlightAll: InputSignal; showFindMatchCase: InputSignal; showFindMultiple: InputSignal; showFindRegexp: InputSignal; showFindEntireWord: InputSignal; showFindMatchDiacritics: InputSignal; showFindResultsCount: InputSignal; showFindMessages: InputSignal; showMovePageButton: InputSignal; disableMovePageButton: InputSignal; showPagingButtons: InputSignal; disablePagingButtons: InputSignal; showFirstAndLastPageButtons: InputSignal; disableFirstAndLastPageButtons: InputSignal; showPreviousAndNextPageButtons: InputSignal; disablePreviousAndNextPageButtons: InputSignal; showPageNumber: InputSignal; disablePageNumber: InputSignal; showPageLabel: InputSignal; showZoomButtons: InputSignal; disableZoomButtons: InputSignal; showZoomDropdown: InputSignal; disableZoomDropdown: InputSignal; showPresentationModeButton: InputSignal; disablePresentationModeButton: InputSignal; showOpenFileButton: InputSignal; disableOpenFileButton: InputSignal; showPrintButton: InputSignal; disablePrintButton: InputSignal; showDownloadButton: InputSignal; disableDownloadButton: InputSignal; theme: InputSignal; showToolbar: InputSignal; showSecondaryToolbarButton: InputSignal; disableSecondaryToolbarButton: InputSignal; showSinglePageModeButton: ModelSignal; showVerticalScrollButton: ModelSignal; showHorizontalScrollButton: ModelSignal; showWrappedScrollButton: ModelSignal; showInfiniteScrollButton: ModelSignal; showBookModeButton: ModelSignal; disableSinglePageModeButton: InputSignal; disableVerticalScrollButton: InputSignal; disableHorizontalScrollButton: InputSignal; disableWrappedScrollButton: InputSignal; disableInfiniteScrollButton: InputSignal; disableBookModeButton: InputSignal; showScrollingButtons: InputSignal; private _showScrollingButtonsEffect; showRotateCwButton: ModelSignal; showRotateCcwButton: ModelSignal; disableRotateCwButton: InputSignal; disableRotateCcwButton: InputSignal; showRotateButton: InputSignal; private _showRotateButtonEffect; handTool: ModelSignal; private _handToolEffect; showHandToolButton: InputSignal; disableHandToolButton: InputSignal; showSpreadButton: InputSignal; disableSpreadButton: InputSignal; showPropertiesButton: InputSignal; disablePropertiesButton: InputSignal; showBorders: InputSignal; spread: ModelSignal; readingDirection: InputSignal<"rtl" | "auto" | "ltr">; thumbnailDrawn: import("@angular/core").OutputEmitterRef; page: ModelSignal; private _pageSetFromScroll; private _pageEffect; private _page; pageLabel: ModelSignal; pagesLoaded: import("@angular/core").OutputEmitterRef; pageRender: import("@angular/core").OutputEmitterRef; pageRendered: import("@angular/core").OutputEmitterRef; pdfDownloaded: import("@angular/core").OutputEmitterRef; pdfLoaded: import("@angular/core").OutputEmitterRef; pdfLoadingStarts: import("@angular/core").OutputEmitterRef; pdfLoadingFailed: import("@angular/core").OutputEmitterRef; textLayer: InputSignal; textLayerRendered: import("@angular/core").OutputEmitterRef; annotationEditorModeChanged: import("@angular/core").OutputEmitterRef; updateFindMatchesCount: import("@angular/core").OutputEmitterRef; updateFindState: import("@angular/core").OutputEmitterRef; /** Legal values: undefined, 'auto', 'page-actual', 'page-fit', 'page-width', or '50' (or any other percentage) */ zoom: ModelSignal; /** * Tracks the last zoom value set from a pdf.js scalechanging event. * Used to break the feedback loop: pdf.js fires scalechanging → Angular updates zoom signal → * effect calls setZoom() → sets currentScaleValue back on pdf.js. During pinch zoom, * the async effect can set an outdated scale value back, causing flicker/jumping. */ private _lastZoomSetByPdfJs; /** * True while pdf.js is actively handling a zoom gesture (pinch or Ctrl+wheel). * During an active gesture, pdf.js uses drawingDelay=400ms to defer page re-rendering * (the page stays blurry and only sharpens after the gesture ends). If Angular's * setZoom() writes currentScaleValue during this window, it bypasses drawingDelay * and triggers an immediate full re-render on every frame, causing stutter on iPad. */ private _isPdfJsZooming; private _pdfJsZoomingTimeout; zoomLevels: InputSignal<(string | number)[]>; maxZoom: InputSignal; minZoom: InputSignal; /** This attribute allows you to increase the size of the UI elements so you can use them on small mobile devices. * This attribute is a string with a percent character at the end (e.g. "150%"). */ _mobileFriendlyZoom: string; mobileFriendlyZoomScale: number; toolbarMarginTop: string; toolbarWidth: string; private toolbar; onToolbarLoaded(toolbarElement: HTMLElement): void; secondaryToolbarTop: string | undefined; sidebarPositionTop: string | undefined; editorParamsToolbarTop: string | undefined; findbarTop: string | undefined; findbarLeft: string | undefined; private initializationPromise; private checkRootElementTimeout; private destroyInitialization; get pdfJsVersion(): string; get majorMinorPdfJsVersion(): string; get enableSignatureEditor(): boolean; get enablePageReordering(): boolean; /** * This attributes allows you to increase the size of the UI elements so you can use them on small mobile devices. * This attribute is a string with a percent character at the end (e.g. "150%"). */ mobileFriendlyZoom: InputSignal; private _mobileFriendlyZoomEffect; private _zoomEffect; private _maxZoomEffect; private _minZoomEffect; private _findbarVisibleEffect; private _propertiesDialogVisibleEffect; private _pageLabelEffect; private _rotationEffect; private _activeSidebarViewEffect; private _filenameForDownloadEffect; private _nameddestEffect; private _spreadEffect; private _secondaryMenuEmptyEffect; private _enableDragAndDropEffect; private _printResolutionEffect; private _keyboardSettingsEffect; private _replaceBrowserPrintEffect; private _disableFormsEffect; private _showBordersEffect; private _showUnverifiedSignaturesEffect; private _enablePrintEffect; private _customComponentsEffect; serverSideRendering: boolean; /** * Checks if the code is running in a browser environment. */ private isBrowser; calcViewerPositionTop(): void; constructor(platformId: Object, notificationService: PDFNotificationService, elementRef: ElementRef, platformLocation: PlatformLocation, cdr: ChangeDetectorRef, service: NgxExtendedPdfViewerService, renderer: Renderer2, pdfScriptLoaderService: PDFScriptLoaderService, keyboardManager: NgxKeyboardManagerService, cspPolicyService: PdfCspPolicyService, iosCanvasService: IOSCanvasOptimizationService, ngZone: NgZone); /** * Detects if the application is running in zoneless mode (Angular 21+) * @returns true if zone.js is not present */ private isZoneless; /** * Wraps an async callback to ensure change detection in zoneless mode. * In zone.js mode: Zero overhead - Zone handles change detection automatically * In zoneless mode: Manually triggers change detection after callback * * @param callback The function to execute * @returns Wrapped function that triggers CD in zoneless mode * * @example * // Instead of: * queueMicrotask(() => this.progress.emit(x)); * * // Use: * queueMicrotask(this.asyncWithCD(() => this.progress.emit(x))); */ private asyncWithCD; private reportSourceChanges; private handleStoredValuesAvailable; ngOnInit(): Promise; private initialize; private waitForRootElement; private waitUntilOldComponentIsGone; private assignTabindexes; private showElementsRecursively; private collectElementPositions; /** * Collect focusable elements from a popup identified by aria-controls ID * These elements should appear in tab order immediately after the trigger button */ private collectPopupElements; private readonly afterPrintListener; private readonly beforePrintListener; private guessFilenameFromUrl; private doInitPDFViewer; private addTranslationsUnlessProvidedByTheUser; private hideToolbarIfItIsEmpty; /** Notifies every widget that implements onLibraryInit() that the PDF viewer objects are available */ private afterLibraryInit; onSpreadChange(newSpread: 'off' | 'even' | 'odd'): void; private readonly toggleVisibility; private activateTextlayerIfNecessary; private overrideDefaultSettings; private openPDF; private registerEventListeners; openPDF2(): Promise; private selectCursorTool; doReplaceBrowserPrint(useCustomPrintOfPdfJS: boolean): void; ngOnDestroy(): Promise; private isPrimaryMenuVisible; private closeDocument; private setZoom; initResizeObserver(): void; onResize(): void; onContextMenu(): boolean; private pageHasVisibleSignature; scrollSignatureWarningIntoView(pdf: PDFDocumentProxy): Promise; zoomToPageWidth(event: MouseEvent): Promise; private enableOrDisableForms; closeCommentsSidebar(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }