pdfjs-serverless
Version:
PDF.js redistributed as a single bundle for edge and serverless runtimes
23 lines (20 loc) • 713 B
text/typescript
import * as PDFJS from './types/src/pdf'
/**
* @deprecated Import from `pdfjs-serverless` instead. Will be removed in v2.
* @example
* import { getDocument } from 'pdfjs-serverless'
*
* const buffer = await fetch('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')
* .then(res => res.arrayBuffer())
*
* const document = await getDocument({
* data: new Uint8Array(buffer),
* useSystemFonts: true,
* }).promise
*
* console.log(await document.getMetadata())
*/
declare function resolvePDFJS(): Promise<typeof PDFJS>
export { resolvePDFJS }
export * from './types/src/pdf'
export type { TextContent, TextItem, TextMarkedContent, TextStyle } from './types/src/display/api'