UNPKG

@josef-pokorny/svelte-pdf

Version:

svelte-pdf provides a component for rendering PDF documents using PDF.js

49 lines (48 loc) 1.84 kB
import type { PDFDocumentProxy } from "pdfjs-dist"; /** * Print entire pdf pages * @param {String} url pdf url * */ export declare const onPrint: (url: string) => void; /** * Calculate reading time of entire pdf document * @param {String} paraBody pdf text to calculate reading time * */ export declare const calcRT: (paraBody: string) => number | undefined; /** * Retrieves the text of a specif page within a PDF Document obtained through pdf.js * * @param {Integer} pageNum Specifies the number of the page * @param {PDFDocument} PDFDocumentInstance The PDF document obtained **/ export declare const getPageText: (pageNum: number, PDFDocumentInstance: PDFDocumentProxy) => Promise<unknown>; /** * Saves a PDF Blob as a file with the given name. * * @param {String} fileUrl - The PDF url to save. * @param {String} data - base64 decoded string * @param {string} name - The name to use for the saved file. */ export declare const savePDF: ({ fileUrl, data, name, }: { fileUrl: string; data: string | null; name: string; }) => Promise<void>; interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { $$bindings?: Bindings; } & Exports; (internal: unknown, props: { $$events?: Events; $$slots?: Slots; }): Exports & { $set?: any; $on?: any; }; z_$$bindings?: Bindings; } declare const Helper: $$__sveltets_2_IsomorphicComponent<Record<string, never>, { [evt: string]: CustomEvent<any>; }, {}, {}, string>; type Helper = InstanceType<typeof Helper>; export default Helper;