PdfInput
このコンテンツはまだ日本語訳がありません。
PdfInput =
string|Buffer|Uint8Array|ArrayBuffer
Defined in: packages/core/src/types.ts:33
Input types that can be used to open a PDF document.
Supported input types:
string- File path to a PDF fileBuffer- Node.js Buffer containing PDF dataUint8Array- Typed array containing PDF dataArrayBuffer- Raw binary data containing PDF
Example
// From file pathconst pdf = await openPdf('/path/to/document.pdf')
// From Bufferconst buffer = await fs.readFile('/path/to/document.pdf')const pdf = await openPdf(buffer)
// From Uint8Array (e.g., from fetch)const response = await fetch('https://example.com/document.pdf')const data = new Uint8Array(await response.arrayBuffer())const pdf = await openPdf(data)