https://github.com/lob/pdffonts
Node bindings for Poppler's pdffonts CLI
https://github.com/lob/pdffonts
postmasters
Last synced: about 1 month ago
JSON representation
Node bindings for Poppler's pdffonts CLI
- Host: GitHub
- URL: https://github.com/lob/pdffonts
- Owner: lob
- License: mit
- Created: 2016-05-10T17:43:09.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T14:41:15.000Z (about 1 year ago)
- Last Synced: 2025-04-22T10:46:57.277Z (about 2 months ago)
- Topics: postmasters
- Language: JavaScript
- Size: 2.9 MB
- Stars: 4
- Watchers: 42
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# pdffonts
[](https://github.com/lob/pdffonts/actions/workflows/ci.yaml)
Node bindings for Poppler's `pdffonts` CLI.
## Dependencies
For this module to install and build correctly, you'll need to make sure that [`poppler`](https://poppler.freedesktop.org/) is installed on your machine.
To install Poppler on Mac OS X using Homebrew:
```
brew install poppler
```To install Poppler on Ubuntu/Debian:
```
apt-get install pkg-config
apt-get install libpoppler-private-dev
apt-get install poppler-data
```## Usage
#### `PDFFonts.fonts()`
```
Returns an array of font objects.
@param {String} path - path to the PDF
@returns {Array} array of font objects
```Here's an example font object:
```js
{
name: 'LDJWDV+DejaVuSerif-Bold',
type: 'CID TrueType',
encoding: 'Identity-H',
embedded: true,
subset: true,
unicode: true,
object: {
number: 8,
generation: 0
}
}
```## Testing
```bash
$ npm i
$ npm test
```## Coverage
The coverage report is generated using [`lcov`](http://ltp.sourceforge.net/coverage/lcov.php), so you need to make sure you have it installed:
To install `lcov` on Mac OS X using Homebrew:
```bash
$ brew install lcov
```To install `lcov` on Ubuntu 14.04:
```bash
$ apt-get install lcov
```Once it's installed, you can generate a `coverage.info` file by running:
```bash
$ npm run cover
```If you want to view it as an HTML file to see which lines haven't been covered, you can run the following to generate a `coverage/index.html`:
```bash
$ npm run cover:html
```## Linting
```bash
$ npm run lint
```