/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { currentPage } from '@progress/kendo-pdfviewer-common'; import * as React_2 from 'react'; import { SaveOptions } from '@progress/kendo-file-saver'; import { ToolbarProps } from '@progress/kendo-react-buttons'; import { TypedArray } from '@progress/kendo-pdfviewer-common'; export { currentPage } /** * The KendoReact [PDF Viewer]({% slug api_pdf-viewer_pdfviewer %}) DownloadEvent object. */ export declare interface DownloadEvent extends PDFViewerEvent { /** * The Blob object. */ blob: Blob; /** * The name which will be used for saving the file. */ fileName: string; /** * The options which will be used for saving the file. */ saveOptions: SaveOptions; } /** * The KendoReact [PDF Viewer]({% slug api_pdf-viewer_pdfviewer %}) ErrorEvent object. */ declare interface ErrorEvent_2 extends PDFViewerEvent { /** * The raised error. */ error: Error | { message: string; }; } export { ErrorEvent_2 as ErrorEvent } /** * The KendoReact [PDF Viewer]({% slug api_pdf-viewer_pdfviewer %}) LoadEvent object. */ export declare interface LoadEvent extends PDFViewerEvent { } /** * The KendoReact [PDF Viewer]({% slug api_pdf-viewer_pdfviewer %}) PageEvent object. */ export declare interface PageEvent extends PDFViewerEvent { /** * The page number. */ page: number; /** * A React `SyntheticEvent`. */ syntheticEvent: React_2.SyntheticEvent; } /** * Represents the [KendoReact PDF Viewer component]({% slug api_pdf-viewer_pdfviewerprops %}). * * @example * ```jsx * function App() { * return ; * } * ReactDOM.render(, document.querySelector('my-app')); * ``` */ export declare const PDFViewer: React_2.ForwardRefExoticComponent>; declare interface PDFViewerEvent { /** * The event target object. */ target: PDFViewerHandle; } /** * Represents the object which is passed to the [`ref`](https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom) * callback of the [PDF Viewer]({% slug api_pdf-viewer_pdfviewer %}) component. */ export declare interface PDFViewerHandle { /** * The root DOM element of the PDF Viewer component. */ element: HTMLDivElement | null; /** * The props of the PDF Viewer component. */ props: PDFViewerProps; /** * The `PDF.js` document loaded in the PDF Viewer component. */ document: any; /** * The `PDF.js` pages loaded in the PDF Viewer component. */ pages: any[]; } /** * The props of the KendoReact [PDF Viewer]({% slug api_pdf-viewer_pdfviewer %}) component. */ export declare interface PDFViewerProps { /** * Represents the URL of the PDF file. * * @example * ```jsx * * ``` */ url?: string; /** * Represents the data of the PDF file in Base64 format. * * @example * ```jsx * * ``` */ data?: string; /** * Represents the raw binary data buffer of the PDF file. * * @example * ```jsx * * ``` */ arrayBuffer?: ArrayBuffer; /** * Represents the data of the PDF file in typed array format. * * @example * ```jsx * * ``` */ typedArray?: TypedArray; /** * Represents the additional styles which will be added to the PDF Viewer component. * * @example * ```jsx * * ``` */ style?: React_2.CSSProperties; /** * Represents the file name used to save the file when the user clicks the download tool. * * @example * ```jsx * * ``` */ saveFileName?: string; /** * Represents the options for saving the file when the user clicks the download tool. * * @example * ```jsx * * ``` */ saveOptions?: SaveOptions; /** * Represents the tools collection rendered in the toolbar. * * @default - ['pager', 'spacer', 'zoomInOut', 'zoom', 'selection', 'spacer', 'search', 'open', 'download', 'print'] * * @example * ```jsx * * ``` */ tools?: PDFViewerTool[]; /** * Represents the zoom levels populated in the ComboBox component. * * @example * ```jsx * * ``` */ zoomLevels?: { id: number; priority: number; value: number; text: string; type: string; locationString?: string; }[]; /** * Represents the zoom value of the document. * * @example * ```jsx * * ``` */ zoom?: number; /** * Represents the default zoom value. * * @example * ```jsx * * ``` */ defaultZoom?: number; /** * Represents the minimum zoom value. * * @example * ```jsx * * ``` */ minZoom?: number; /** * Represents the maximum zoom value. * * @example * ```jsx * * ``` */ maxZoom?: number; /** * Represents the zoom rate value. * * @example * ```jsx * * ``` */ zoomRate?: number; /** * Fires when an error occurs. * * @example * ```jsx * console.log(event.error)} /> * ``` */ onError?: (event: ErrorEvent_2) => void; /** * Fires when a PDF document has been loaded. * * @example * ```jsx * console.log('Document loaded')} /> * ``` */ onLoad?: (event: LoadEvent) => void; /** * Fires when the download tool has been clicked. To prevent the download, return `false`. * * @example * ```jsx * console.log(event.fileName)} /> * ``` */ onDownload?: (event: DownloadEvent) => boolean | void; /** * Fires when the zoom has changed. * * @example * ```jsx * console.log(event.zoom)} /> * ``` */ onZoom?: (event: ZoomEvent) => void; /** * Fires when the page has changed. * * @example * ```jsx * console.log(event.page)} /> * ``` */ onPageChange?: (event: PageEvent) => void; /** * Fires when the toolbar component is about to be rendered. Use it to override the default appearance of the toolbar. * * @example * ```jsx * } /> * ``` */ onRenderToolbar?: (defaultRendering: React_2.ReactElement) => React_2.ReactNode; /** * Fires when the content component is about to be rendered. Use it to override the default appearance of the content. * * @example * ```jsx * } /> * ``` */ onRenderContent?: (defaultRendering: React_2.ReactElement) => React_2.ReactNode; /** * Fires when the loading indication component is about to be rendered. Use it to override the default appearance of the loading. * * @example * ```jsx * } /> * ``` */ onRenderLoader?: (defaultRendering: React_2.ReactElement | null) => React_2.ReactNode; } export declare type PDFViewerTool = 'pager' | 'spacer' | 'zoomInOut' | 'zoom' | 'selection' | 'search' | 'open' | 'download' | 'print'; /** * Scrolls the PDF Viewer document to the passed page number. * * @param rootElement The root HTML element of the PDF Viewer component. * @param pageNumber The page number. * * @example * ```jsx * function App() { * const pdfRef = React.useRef(null); * const handleClick = () => { * scrollToPage(pdfRef.current.element, 3); * }; * return ( *
* * *
* ) * } * ``` */ export declare const scrollToPage: (rootElement: HTMLElement, pageNumber: number) => void; /** * The KendoReact [PDF Viewer]({% slug api_pdf-viewer_pdfviewer %}) ZoomEvent object. */ export declare interface ZoomEvent extends PDFViewerEvent { /** * The zoom value. */ zoom: number; /** * A React `SyntheticEvent`. */ syntheticEvent: React_2.SyntheticEvent; } export { }