npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-podofo

v1.2.0

Published

Node.js bindings for the PoDoFo PDF library.

Downloads

6

Readme

Node-Podofo

Build Status Build Status

Node-podofo in a Node addons written in C++ to manipulate & read PDF files (create pdf, get metadata, information, author, get text from pdf ...).

This is an updated fork of podofo

Why this fork ?

This fork compile 3 years of podofo dev (from 0.9.3 to 0.9.5) And it add the possibility to DISABLE DEBUG & LOG by default which was really terrible when using with Node.js

Why Node-podofo

Of course you can use pdfjs in full js, but if speed & error catcher are important for you node-podofo is here.

Because it's a native addons written in C++, it is very speed & you can use the function directly in your project just like all npm module.

It's not just a spawn of a command so error, returned value .. can be managed in Javascript as easy as pie.

It fully intregates all require Libraries, nothing to install more.

Bindings for the PoDoFo PDF Library

This project provides Node.js bindings for the PoDoFo PDF library.

Basic functionality has been implemented, but this is generally a work in progress. Pull requests are welcome.

Installing

This requires libpodofo to be installed. If you are using Ubuntu, the following command should suffice:

sudo apt-get install libpodofo-dev

Then, installing this library is as simple as:

npm install podofo

Using with node

const podofo = require('podofo');

let pdf = new podofo.PdfMemDocument(false);
pdf.Load('/path/to/a/file.pdf');

console.log(pdf.GetInfo().GetAuthor());
// Will return software author

Building on Windows

PoDoFo (minimally) depends on zlib and freetype. You will also need the source for PoDoFo itself. You can download these packages and extract them into deps/.

After extraction, the directory tree should look like this:

  • deps/
    • freetype/
    • podofo/
    • zlib/

The following versions have been tested:

  • freetype: 2.8
  • podofo: 0.9.5
  • zlib: 1.2.11

Then you just need to run node-pre-gyp configure build to obtain a binary.

Of course, you will also need to have a toolchain installed. This has been tested with Visual Studio 2015. The Community edition is available from Microsoft for free.

Examples

You can exec a simple GetAuthor() & text-extractor:

From your main module(main-module/node_modules/node-podofo) just launch:

node node_modules/node-podofo/index.js

Dev

To complie from source node-podofo just :

git submodule init
git submodule update
npm install --build-from-source

This will recreate the bin in ./lib

Debug & Logs

By default log & debug are disable, to enable them when you can just pass true option to PdfMemDocument as:

var pdf = new podofo.PdfMemDocument(true);

Notice

All Podofo Classes cannot be used directly, for example, PdfError could be called only via c++, not javascript binding. If you want to update this fork, you must know about c++/Node.js, podofo, node-addons, Nan V8, node-pre-gyp, node-pre-gyp-github & use travis for build for OSX+Linux and Appveyor to build for Windows.