We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 75a8d86 + e31eac7 commit 6702db0Copy full SHA for 6702db0
src/pdf-to-png.ts
@@ -3,13 +3,13 @@
3
*/
4
import { readFileSync } from 'node:fs'
5
import { dirname, join } from 'node:path'
6
-import { getDocument } from 'pdfjs-dist/legacy/build/pdf.mjs'
7
8
const PDFJS_DIR = join(dirname(require.resolve('pdfjs-dist')), '..')
9
10
export async function pdfToPng(
11
pdf: string | Buffer
12
): Promise<Buffer[]> {
+ const { getDocument } = await import('pdfjs-dist/legacy/build/pdf.mjs')
13
14
// Load PDF
15
const data = new Uint8Array(Buffer.isBuffer(pdf) ? pdf : readFileSync(pdf))
0 commit comments