{"_id":"@alimamed/html-pdf","_rev":"3-bd9d3c4fb1a820dfc4ca91de684142fb","name":"@alimamed/html-pdf","dist-tags":{"latest":"3.0.2"},"versions":{"3.0.0":{"name":"@alimamed/html-pdf","version":"3.0.0","description":"HTML to PDF converter that uses phantomjs","engines":{"node":">=4.0.0"},"main":"lib/index.js","directories":{"test":"test"},"bin":{"html-pdf":"bin/index.js"},"scripts":{"test":"standard && tape test/index.js examples/*/test.js"},"author":{"name":"Ali Mamed"},"license":"MIT","devDependencies":{"standard":"^5.1.1","tap-spec":"^2.2.0","tape":"^3.4.0"},"optionalDependencies":{"phantomjs-prebuilt":"^2.1.4"},"repository":{"type":"git","url":"git://github.com/AliMamed/node-html-pdf.git"},"keywords":["html","pdf","phantom","phantomjs","nodejs"],"bugs":{"url":"https://github.com/AliMamed/node-html-pdf/issues"},"homepage":"https://github.com/AliMamed/node-html-pdf","dependencies":{"dompurify":"^2.0.8","jsdom":"^16.1.0","phantomjs-prebuilt":"^2.1.4"},"gitHead":"16959e3023ab8877310c7167b3d4c49b36f87f0b","_id":"@alimamed/html-pdf@3.0.0","_nodeVersion":"12.16.1","_npmVersion":"6.14.11","dist":{"integrity":"sha512-cUELh5P5sGFOSwDt+ZY2pRpMH2vuxIsGtlAoLIcNAnga6BpTKXk2pMwfbjdM0wS2IulWJBTBhaeeFWP+REz1VA==","shasum":"90a164250b18bca77c6a223c26f37da26fe59395","tarball":"https://registry.npmjs.org/@alimamed/html-pdf/-/html-pdf-3.0.0.tgz","fileCount":12,"unpackedSize":117695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGRsICRA9TVsSAnZWagAAi2AP/j4ieCM4aoMr76dlUdMd\nHJcB4avMGrCLAKrdsoSwhoOGetUWdtKwVYao9ocB2O3mxdmlaNNENm2WkAAL\nAK0TG4wWZEMnapAN3RufAXJKSX4wHaELOZs0qlhgBVk3JuQNIo92P5iqu8z4\n2TfvJWXl1aaQVK4+1Fkb8rrRYLwxOl4t++JoVakgW3I69oZqToqB+KhYT0/T\n9yjxrLlV/nurkNmMiZ/jTQkkT0+ZOXF51GGU9XdoKm++YPitIwOVZ2PHFTCc\nqtKDscmPlK6lKqzqOvZKe64M80iZ5bT7xsuQJZgrkbWFqWj0+bd4pWRfNBdM\nc9rJONxyZP7954CN5CIChrmUxJUcRXekcRZg0pCh5ZjJsW40F0UvvtfdvIS/\n86+qnP+4KNnvNcRp1Pdvh2nFvqID8mPT6qz0FsnrsUbzVWL2hH8wgwrPtmR/\nPuV/cKP+HFFQUh6MI/9DWyRV83XVMh7UsE30yMV2G0UFCr0clo9G7SWgXBNp\nYYbA9OjR1z8hPyBMyNc5d8HDcsyV0Rt5hF2dp/0S7xy7vYIc8vBs8nwBE1GK\nDfzqmSFJEHOj2sahiMLVfXv4XLPIzr3K6XeKIdUBiIz7Q5CTAIYkbPhrqGfP\nFlC008URI5tQISZmDI0X4NsufkwZ3TVid6v91pAEGQaYgUXH86Vii8jWtlaa\njT4L\r\n=aPw1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPCgDt4ZkwgYdH9GT3EctSrARZV9mkY9LNGqrqAwmpcwIgItDeaWH8r9ycNo9li6aoYXVFnWSSOyYJgczszAIOTH0="}]},"_npmUser":{"name":"alimamed","email":"av@kalite.ro"},"maintainers":[{"name":"alimamed","email":"av@kalite.ro"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/html-pdf_3.0.0_1612258056216_0.858858675897995"},"_hasShrinkwrap":false},"3.0.1":{"name":"@alimamed/html-pdf","version":"3.0.1","description":"HTML to PDF converter that uses phantomjs","engines":{"node":">=4.0.0"},"main":"lib/index.js","directories":{"test":"test"},"bin":{"html-pdf":"bin/index.js"},"scripts":{"test":"tape test/index.js examples/*/test.js"},"author":{"name":"Ali Mamed"},"license":"MIT","devDependencies":{"tap-spec":"^5.0.0","tape":"^5.1.1"},"optionalDependencies":{"bundled-phantomjs-prebuilt":"^2.1.8-0"},"repository":{"type":"git","url":"git://github.com/AliMamed/node-html-pdf.git"},"keywords":["html","pdf","phantom","phantomjs","nodejs"],"bugs":{"url":"https://github.com/AliMamed/node-html-pdf/issues"},"homepage":"https://github.com/AliMamed/node-html-pdf","dependencies":{"dompurify":"^2.2.6","jsdom":"^16.4.0","bundled-phantomjs-prebuilt":"^2.1.8-0"},"gitHead":"502fe3d78a9e85b8d97a940cd74a5d97825c8bb7","_id":"@alimamed/html-pdf@3.0.1","_nodeVersion":"12.16.1","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ojmMl7fUlqKal+SnK8cAaGUIsxDFQ+o1FMrMvY3Yg1VgZuOGIFq+7RGbGyS+tABcqKqfNcdV/ZXwXC6Sx7TImg==","shasum":"0d4bdf37ab85d58370bdf1e82d070c3dae40b8c1","tarball":"https://registry.npmjs.org/@alimamed/html-pdf/-/html-pdf-3.0.1.tgz","fileCount":12,"unpackedSize":117675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGR2jCRA9TVsSAnZWagAALVkP/2i2Sg5XgQAm/W+8CtaQ\n56C35klBQSGXu4TL+zid/AsnpqvSuqvObSzgR9VrYqQbk9GEkhVLGtIiBwD1\nRd3p6Mjq6Ecdh3tUN7iEu7EYlZUX5FPEDss3bverTkrgCmT0C/GXtYm1c9wd\nTzUwJA5xYlj4ujS/4r4bouJ3Rd6LHPR7Ep17sG/IyKkUYrxCuoc/hU/rslDI\nQT8V9MTWM10sezXNb3nJ3GIoOK4FblbSMeV9uB4KXpMmksjuNNZ79ZkETh83\nvUM3DbKx/hNLKVNP/6EG2e8+JljZh2CuLHyfpJF4++HpTZeehFLiU83764uB\nnfF/LNjSruw/E4bXA06RTpLL47KoW8zsUZ/xxrOK5KNEG8JVPED9BwT2o6VC\nUadU2zF2GabBDCSsAiAqnIiW2YmJnIO3ewoyzJ/2Bo5PK91j2LA89+YEbtMd\nMb8x7W1wc5zvEixltOJO19U0z5igrnYT13f8HrhZwguksvbYFFX6a5JzQK9G\nmz7tcivAL31fYJhnpLUgMK5cyJ9gXkfau/tJfQtxzyJswXJos47YFHDa3zY+\nN6rseZYrOnMceljwdggYT2aDLtws60O3Fm/u9AnwqfWhKG1UZBFK5nhYSXMC\n1MvITr+sn2OrAZAE+QhB6rZb92sDaaOholsu1swtYZyol2m8DBFmkaMDKzMr\nwyDc\r\n=FjHP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRDncC3eGNMDpPEii8poZLdLlKwjpkN220XV0CO0BBCwIgUyfdVmNkOYa+2Pw+Vkpwz2Ntr/KTUt/OH0a+VeCr2dE="}]},"_npmUser":{"name":"alimamed","email":"av@kalite.ro"},"maintainers":[{"name":"alimamed","email":"av@kalite.ro"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/html-pdf_3.0.1_1612258723232_0.9371465663974543"},"_hasShrinkwrap":false},"3.0.2":{"name":"@alimamed/html-pdf","version":"3.0.2","description":"HTML to PDF converter that uses phantomjs","engines":{"node":">=4.0.0"},"main":"lib/index.js","directories":{"test":"test"},"bin":{"html-pdf":"bin/index.js"},"scripts":{"test":"tape test/index.js examples/*/test.js"},"author":{"name":"Ali Mamed"},"license":"MIT","devDependencies":{"tap-spec":"^5.0.0","tape":"^5.1.1"},"optionalDependencies":{"phantomjs-prebuilt":"^2.1.4"},"repository":{"type":"git","url":"git://github.com/AliMamed/node-html-pdf.git"},"keywords":["html","pdf","phantom","phantomjs","nodejs"],"bugs":{"url":"https://github.com/AliMamed/node-html-pdf/issues"},"homepage":"https://github.com/AliMamed/node-html-pdf","dependencies":{"dompurify":"^2.2.6","jsdom":"^16.4.0","phantomjs-prebuilt":"^2.1.4"},"gitHead":"75407f380e9140cddc9918889c20362e5c7caa1f","_id":"@alimamed/html-pdf@3.0.2","_nodeVersion":"12.16.1","_npmVersion":"6.14.11","dist":{"integrity":"sha512-+hEmANucsQuOo/Z+XTPou520rYbUIYtnXTxqS7nqDmfWMVS7TBXEqYSMJ8l4GK5aKiV7gan/gSOz2riQ2wKkdg==","shasum":"0ec94ca0acb773d72a51ce7e09cb85a81a2394fc","tarball":"https://registry.npmjs.org/@alimamed/html-pdf/-/html-pdf-3.0.2.tgz","fileCount":12,"unpackedSize":117657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGR7oCRA9TVsSAnZWagAA9XoQAISPJ69s5IJFWlBVTGAl\nCtgP50XYItlhSagRa1nkGrANnD4U+S/sjIGPjaq95aDRPStvyOcfq54j6wf+\nWVIMKbtdXwSzr4O4uPDJUVHBmRITADy7ekkwSnnpAqWRso996XkNeU9dVeZ7\ncLuE+jl61EDdZa4CmtJ/doAIDin4Co6TAOE3OM52sEXsGGSTrtwlO5R5+rJo\nfCg1JB2tkf03S3QS6sTDTXSggpJwMp1NHIjzTCQ2vDJNGplWt4gD67mUFmGy\nEuxp08t69+bjJSIladnkm78Fs5IyrSdqXwGFigoqMyalXW5iIuJeWzkStJKm\n+l7fUt/Yq2b55pv0FF1V1wNis76ZZWSFWfNj1rwZcEa4QIn+5+ZA6xaiC0ax\neoq5XwesPRZcZEEAj3U7IX90A9KWgOLD3Rew4REbnegXlMGmqbDOQSJ+BT8G\nQ0si50mU7tbYnHv8jLD9mw9ANpxxVxFW4YFb/KWjCSlDG3G3lwjAp4YccurP\nfAsD8+GtieEV0KSXviZxwruerc93kH5nG0Q1yhG4P7uhzjLbde/ifffGaeF3\n3L1MiPXqiVof8XwLKco8JJf50tMT84T819IveG4iQ3FlzwFYG+FNQooXUpl9\nHGFECmiONjOJ0mDRnGEuRI6BIr98+4x7rZFbu5nF5RiFPfU+xZtk/sl5DN5h\nkerf\r\n=8ssK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHR0bQaqiv+qdtvrjAyP4/WLgc6Aej/lu4NOF9xW/ZO1AiEAzWT+1YiODHdkSJM3cPl7hhBIcfXJ46teX76Gc9SIuco="}]},"_npmUser":{"name":"alimamed","email":"av@kalite.ro"},"maintainers":[{"name":"alimamed","email":"av@kalite.ro"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/html-pdf_3.0.2_1612259048150_0.58382919355491"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-02T09:27:36.182Z","3.0.0":"2021-02-02T09:27:36.373Z","modified":"2022-04-04T13:26:04.922Z","3.0.1":"2021-02-02T09:38:43.379Z","3.0.2":"2021-02-02T09:44:08.310Z"},"maintainers":[{"name":"alimamed","email":"av@kalite.ro"}],"description":"HTML to PDF converter that uses phantomjs","homepage":"https://github.com/AliMamed/node-html-pdf","keywords":["html","pdf","phantom","phantomjs","nodejs"],"repository":{"type":"git","url":"git://github.com/AliMamed/node-html-pdf.git"},"author":{"name":"Ali Mamed"},"bugs":{"url":"https://github.com/AliMamed/node-html-pdf/issues"},"license":"MIT","readme":"# node-html-pdf\n## HTML to PDF converter that uses phantomjs\n![image](examples/businesscard/businesscard.png)  \n[Example Business Card](examples/businesscard/businesscard.pdf)  \n-> [and its Source file](examples/businesscard/businesscard.html)\n\n[Example Receipt](http://imgr-static.s3-eu-west-1.amazonaws.com/order.pdf)\n\nForked from [marcbachmann/node-html-pdf](https://github.com/marcbachmann/node-html-pdf) and fixed Arbitrary file read with this [PR](https://github.com/marcbachmann/node-html-pdf/pull/556)\n\n## Changelog\n\nHave a look at the releases page: https://github.com/AliMamed/node-html-pdf/releases\n\n## Installation\n\nInstall the html-pdf utility via [npm](http://npmjs.org/):\n\n```\n$ npm install -g html-pdf\n```\n\n## Command-line example\n\n```\n$ html-pdf test/businesscard.html businesscard.pdf\n```\n\n## Code example\n```javascript\nvar fs = require('fs');\nvar pdf = require('html-pdf');\nvar html = fs.readFileSync('./test/businesscard.html', 'utf8');\nvar options = { format: 'Letter' };\n\npdf.create(html, options).toFile('./businesscard.pdf', function(err, res) {\n if (err) return console.log(err);\n console.log(res); // { filename: '/app/businesscard.pdf' }\n});\n```\n\n## API\n\n```js\nvar pdf = require('html-pdf');\npdf.create(html).toFile([filepath, ]function(err, res){\n console.log(res.filename);\n});\n\npdf.create(html).toStream(function(err, stream){\n stream.pipe(fs.createWriteStream('./foo.pdf'));\n});\n\npdf.create(html).toBuffer(function(err, buffer){\n console.log('This is a buffer:', Buffer.isBuffer(buffer));\n});\n\n\n// for backwards compatibility\n// alias to pdf.create(html[, options]).toBuffer(callback)\npdf.create(html [, options], function(err, buffer){});\n```\n\n### Footers and Headers\n\n`html-pdf` can read the header or footer either out of the `footer` and `header` config object or out of the html source. You can either set a default header & footer or overwrite that by appending a page number (1 based index) to the `id=\"pageHeader\"` attribute of a html tag.\n\nYou can use any combination of those tags. The library tries to find any element, that contains the `pageHeader` or `pageFooter` id prefix.\n```html\n<div id=\"pageHeader\">Default header</div>\n<div id=\"pageHeader-first\">Header on first page</div>\n<div id=\"pageHeader-2\">Header on second page</div>\n<div id=\"pageHeader-3\">Header on third page</div>\n<div id=\"pageHeader-last\">Header on last page</div>\n...\n<div id=\"pageFooter\">Default footer</div>\n<div id=\"pageFooter-first\">Footer on first page</div>\n<div id=\"pageFooter-2\">Footer on second page</div>\n<div id=\"pageFooter-last\">Footer on last page</div>\n```\n\n\n## Options\n```javascript\nconfig = {\n\n         // Export options\n         \"directory\": \"/tmp\",       // The directory the file gets written into if not using .toFile(filename, callback). default: '/tmp'\n\n         \"readLocalFile\": false,     // Option to help specify if access to 'local files' is allowed or not (default *false* to avoid 'arbitrary file read')\n\n         // Papersize Options: http://phantomjs.org/api/webpage/property/paper-size.html\n         \"height\": \"10.5in\",        // allowed units: mm, cm, in, px\n         \"width\": \"8in\",            // allowed units: mm, cm, in, px\n        - or -\n        \"format\": \"Letter\",        // allowed units: A3, A4, A5, Legal, Letter, Tabloid\n        \"orientation\": \"portrait\", // portrait or landscape\n\n        // Page options\n        \"border\": \"0\",             // default is 0, units: mm, cm, in, px\n- or -\n\"border\": {\n \"top\": \"2in\",            // default is 0, units: mm, cm, in, px\n         \"right\": \"1in\",\n         \"bottom\": \"2in\",\n         \"left\": \"1.5in\"\n},\n\npaginationOffset: 1,       // Override the initial pagination number\n        \"header\": {\n \"height\": \"45mm\",\n         \"contents\": '<div style=\"text-align: center;\">Author: Marc Bachmann</div>'\n},\n\"footer\": {\n \"height\": \"28mm\",\n         \"contents\": {\n  first: 'Cover page',\n          2: 'Second page', // Any page number is working. 1-based index\n default: '<span style=\"color: #444;\">{{page}}</span>/<span>{{pages}}</span>', // fallback value\n          last: 'Last Page'\n }\n},\n\n\n// Rendering options\n\"base\": \"file:///home/www/your-asset-path\", // Base path that's used to load files (images, css, js) when they aren't referenced using a host\n\n        // Zooming option, can be used to scale images if `options.type` is not pdf\n        \"zoomFactor\": \"1\", // default is 1\n\n        // File options\n        \"type\": \"pdf\",             // allowed file types: png, jpeg, pdf\n        \"quality\": \"75\",           // only used for types png & jpeg\n\n        // Script options\n        \"phantomPath\": \"./node_modules/phantomjs/bin/phantomjs\", // PhantomJS binary which should get downloaded automatically\n        \"phantomArgs\": [], // array of strings used as phantomjs args e.g. [\"--ignore-ssl-errors=yes\"]\n        \"script\": '/url',           // Absolute path to a custom phantomjs script, use the file in lib/scripts as example\n        \"timeout\": 30000,           // Timeout that will cancel phantomjs, in milliseconds\n\n        // Time we should wait after window load\n        // accepted values are 'manual', some delay in milliseconds or undefined to wait for a render event\n        \"renderDelay\": 1000,\n\n        // HTTP Headers that are used for requests\n        \"httpHeaders\": {\n // e.g.\n \"Authorization\": \"Bearer ACEFAD8C-4B4D-4042-AB30-6C735F5BAC8B\"\n},\n\n// To run Node application as Windows service\n\"childProcessOptions\": {\n \"detached\": true\n}\n\n// HTTP Cookies that are used for requests\n\"httpCookies\": [\n // e.g.\n {\n  \"name\": \"Valid-Cookie-Name\", // required\n  \"value\": \"Valid-Cookie-Value\", // required\n  \"domain\": \"localhost\",\n  \"path\": \"/foo\", // required\n  \"httponly\": true,\n  \"secure\": false,\n  \"expires\": (new Date()).getTime() + (1000 * 60 * 60) // e.g. expires in 1 hour\n }\n]\n\n}\n```\n\nThe full options object gets converted to JSON and will get passed to the phantomjs script as third argument.  \nThere are more options concerning the paperSize, header & footer options inside the phantomjs script.\n","readmeFilename":"README.md"}