@taggun/pdfium
v12.0.1
Published
Node.js/iojs/node-webkit native pdfium port
Downloads
3
Readme
@taggun/node-pdfium
Render PDF files in node. Much better support for fonts and less rendering issues than libraries like PDF.js in node.
node-pdfium is a fork, updated to support Node 12 LTS. It is used by TAGGUN to scan receipts and invoices.
node-pdfium-native
Native port of PDFium to node.js, iojs and Nw.js.
The main motivation of this project is to render/convert a PDF
format direct into EMF
format, to be able to print on windows printer by using native printer module.
Methods:
getSupportedOutputFormats()
- returns an array of all supported output formats:['BPM', 'EMF', 'PNG', 'PPM']
. Note thatEMF
andBMP
formats are supported only on windows.render(options, [callback(err, pages)])
- render/convert a PDF data into one of output format fromgetSupportedOutputFormats()
. Parameters:option
(object, mandatory) may contains the following fields:data
(Buffer, mandatory) - PDF data bufferoutputFormat
(String, mandatory) - output format name. one fromgetSupportedOutputFormats()
scaleFactor
(Number, optional, default: 1.0) - scale factor of the output format.
callback(err, pages)
(function, optional) - callback function.pages
is array of buffers. If callback is missing, then thepages
will be returned fromrender(options)
. In case of error, an exception will be thrown.
License:
BSD
- feel free to use and support.