ab-pdf-extract

1.0.1 • Public • Published

ab-pdf-extract

Extract pages from a PDF into canvas elements on the client side.

Uses the module 'pdfjs-dist' to extract pages.

Install

With npm do:

$ npm install ab-pdf-extract --save-dev

Usage

var pdf_extract = require('ab-pdf-extract')

var callBack = function(canvases) {
	console.log('canvases:');
	console.dir(canvases);
}

pdf_extract.extractPDF({
	pdfPath 		: ./somepdf.pdf', 		// required - path to PDF file
	pdfWorkerPath 	: './pdfjs.worker.js', 	// optional - path to JS worker file. must be original file from PDFjs
	callBack		: function(){}, 		// required - if you want to get the result array containing all the canvas elements
	maxWidth		: 500, 					// optional - limit the width of the result canvas elements
	maxHeight		: 500, 					// optional - limit the width of the result canvas elements
});

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i ab-pdf-extract

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • antoniobrandao