pdf-signature
v0.0.4
Published
PDF signature
Downloads
8
Readme
PDF - HTML SIGNATURE (GUIDE)
INIT NODE PROJECT
git init
INSTALL DEPENDENCIES
npm install --save html-pdf-signature
CREATE THE INDEX FILE
touch index.js
IMPORT THE LIB IN index.js
const signature = require('html-pdf-signature'); // include from node_modules
const PDFSignature = new signature(); // initialize instance
// HTML SIGNATURE WITH STATIC PATH
PDFSignature.htmlSignature('tests/doc.html', '', 200, 354, 'image in base64', true, 'name output file.html', 'html');
// HTML DOC TO PDF (signed)
PDFSignature.htmlSignature('tests/doc.html', '', 200, 354, 'image in base64', true, 'name output file.html', 'pdf');
// HTML SIGNATURE FROM HTML STRING
PDFSignature.htmlSignature('', '<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
' <meta charset="UTF-8">\n' +
' <title>Something document</title>\n' +
'</head>\n' +
'<body>\n' +
'<h1>LOR DOLOR ISPUM</h1>\n' +
'<div>\n' +
' <span>\n' +
' Something\n' +
' </span>\n' +
' <p>That paragraph</p>\n' +
' <h2>Header 2</h2>\n' +
'</div>\n' +
'<div>\n' +
' <button>Something</button>\n' +
'</div>\n' +
'\n' +
'</body>\n' +
'</html>\n', 200, 354, 'this is generated file', true, 'name output file.html', 'html');
// PDF SIGNATURE
PDFSignature.pdfSignature('tests/doc', 200, 365, 'image in base64', true, 'name output file');
BOOT THE APP
node index.js