UNPKG

@tuttarealstep/vue-pdf.js

Version:

A Vue component for displaying PDF files using the standard `pdf.js` viewer. This package provides a simple and powerful integration to embed PDF viewers in Vue applications.

28 lines (27 loc) 1.1 kB
import { TypedArray, DocumentInitParameters, PDFDocumentLoadingTask, OnProgressParameters } from 'pdf.js/src/display/api'; import { Metadata } from 'pdf.js/src/display/metadata'; export type OnProgressCallback = (progressData: OnProgressParameters) => void; export type UpdatePasswordFn = (newPassword: string) => void; export type OnPasswordCallback = (updatePassword: UpdatePasswordFn, reason: any) => void; export type OnErrorCallback = (error: any) => void; export interface PDFSourceOptions { onProgress?: OnProgressCallback; onPassword?: OnPasswordCallback; onError?: OnErrorCallback; password?: string; } export type PDFSource = string | URL | TypedArray | ArrayBuffer | DocumentInitParameters | File | Blob | PDFDocumentLoadingTask | undefined | null; export interface PDFSourceWithOptions { source?: PDFSource; options?: PDFSourceOptions; } export interface PDFInfoMetadata { info: any; metadata: Metadata; } export interface PDFInfo { metadata: PDFInfoMetadata; attachments: Record<string, unknown>; javascript: string[] | null; outline: any; }