Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

tepez/node-tepez-pdf-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-tepez-pdf-tools

A Node.js wrapper for the tepez-pdf-tools command line tool.

Usage

To use with nailgun: The nailgun server be running. If ng (the nailgun client) is not on PATH, then TP_PDF_TOOLS_NG_PATH must point to it.

To use without nailgun: If tepez-pdf-tools.jar is not on working directory, then TP_PDF_TOOLS_JAR_PATH must point to it.

const PdfTools = require('tepez-pdf-tools');

// path
PdfTools({ sourcePath: "c:/in.pdf" }).pipe(fs.createWriteStream('out.pdf'));
  
// content
PdfTools({ sourceContent: "%PDF-1.5..." }).pipe(res);
  
// Optional callback
const stream = PdfTools({ sourceContent: "%PDF-1.5..." }, function(err) {
  if (err) {
    // handle error
  } else {
    // user `stream`
  }
);

Get a report of the form fields in the file

const PdfTools = require('tepez-pdf-tools');

// path
PdfTools({ 
    sourcePath: "c:/in.pdf",
    getFields: true
}).then((fields) => {
    
);
  

Borrows a-lot from node-wkhtmltopdf

About

A wrapper for tepez-pdf-tools

Resources

Stars

Watchers

Forks

Packages

No packages published