pdf-font-extract
v1.0.0
Published
A lightweight utility to extract embedded fonts from PDF files using pdf.js and opentype.js
Maintainers
Readme
Extract embedded fonts from pdf files
PDF.js doesn't have a convenient API to extract the fonts from the pdf. This is a wrapper on top of PDF.js to help with same.
Install
npm install pdf-font-extractUsage
import extractFonts from 'pdf-font-extract';
const fonts = await extractFonts('./example.pdf');
console.log(fonts);Notes
- Types are provided with JSDoc.
- It's only possible to extract the glyphs that were present in the pdf. Glyphs for characters not found in the pdf will be missing from the font.
