Skip to content

Commit

Permalink
chore: use useSystemFonts: true for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Nov 9, 2023
1 parent 563389e commit d7d1348
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ import { resolvePDFJS } from 'https://esm.sh/pdfjs-serverless'
// Initialize PDF.js
const { getDocument } = await resolvePDFJS()
const data = Deno.readFileSync('sample.pdf')
const doc = await getDocument(data).promise
const doc = await getDocument({
data,
useSystemFonts: true,
}).promise
console.log(await doc.getMetadata())
Expand Down Expand Up @@ -87,7 +90,10 @@ async function handleRequest(request) {
// Initialize PDF.js
const { getDocument } = await resolvePDFJS()
const doc = await getDocument(data).promise
const doc = await getDocument({
data,
useSystemFonts: true,
}).promise
// Get metadata and initialize output object
const metadata = await doc.getMetadata()
Expand Down
5 changes: 4 additions & 1 deletion test/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { resolvePDFJS } from '../dist/index.mjs'

const { getDocument } = await resolvePDFJS()
const data = Deno.readFileSync('fixtures/sample.pdf')
const doc = await getDocument(data).promise
const doc = await getDocument({
data,
useSystemFonts: true,
}).promise

console.log(await doc.getMetadata())

Expand Down

0 comments on commit d7d1348

Please sign in to comment.