Skip to content

Commit

Permalink
feat!: getPDFMeta
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Aug 12, 2023
1 parent 183172d commit 2e818cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { getDocumentProxy } from './utils'

export async function getPDFMeta(data: ArrayBuffer) {
const pdf = await getDocumentProxy(data)
const meta = await pdf.getMetadata().catch(() => null)

return {
info: meta?.info as Record<string, any>,
metadata: meta?.metadata?.getAll(),
}
}

0 comments on commit 2e818cd

Please # to comment.