How to use poppler-simple - 1 common examples

To help you get started, we’ve selected a few poppler-simple examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github calipersjs / calipers / lib / types / pdf.js View on Github external
return new Promise(function (resolve, reject) {
    try {
      var doc = new PopplerDocument(path);

      if (doc.pageCount < 1) {
        return reject(new Error('Invalid PDF'));
      }

      var result = { type: 'pdf', pages: [] };

      for (var i = 1; i <= doc.pageCount; i++) {
        var page = doc.getPage(i);
        result.pages.push({
          width: page.width,
          height: page.height
        });
      }

      resolve(result);

poppler-simple

A simple interface to poppler library

Apache-2.0
Latest version published 2 years ago

Package Health Score

36 / 100
Full package analysis

Popular poppler-simple functions