{"id":22493447,"url":"https://github.com/loicmahieu/pdfkitjs","last_synced_at":"2025-08-03T01:32:12.671Z","repository":{"id":10628673,"uuid":"12851870","full_name":"LoicMahieu/PDFKitJS","owner":"LoicMahieu","description":"HTML+CSS to PDF in Node.JS","archived":false,"fork":false,"pushed_at":"2017-07-31T07:44:56.000Z","size":17,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-29T10:01:37.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LoicMahieu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-15T20:13:17.000Z","updated_at":"2024-10-03T12:10:21.000Z","dependencies_parsed_at":"2022-09-08T00:21:24.506Z","dependency_job_id":null,"html_url":"https://github.com/LoicMahieu/PDFKitJS","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoicMahieu%2FPDFKitJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoicMahieu%2FPDFKitJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoicMahieu%2FPDFKitJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoicMahieu%2FPDFKitJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LoicMahieu","download_url":"https://codeload.github.com/LoicMahieu/PDFKitJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228514788,"owners_count":17932432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T18:39:34.495Z","updated_at":"2024-12-06T18:39:34.996Z","avatar_url":"https://github.com/LoicMahieu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprecation warning\n\n[![deprecated](http://badges.github.io/stability-badges/dist/deprecated.svg)](http://github.com/badges/stability-badges) This module is old and the API is not really consistent. I recommend you to use: https://github.com/devongovett/node-wkhtmltopdf\n\n\n# PDFKitJs\n\nCreate PDFs using plain old HTML+CSS. Uses [wkhtmltopdf](https://github.com/antialize/wkhtmltopdf) on the back-end which renders HTML using Webkit.\n\nHightly inspired by [PDFKit](https://github.com/pdfkit/pdfkit) written in Ruby\n\n## Install\n\n### PDFKit\n```bash\nnpm install pdfkitjs\n```\n### wkhtmltopdf\n\n\u003chttps://github.com/pdfkit/pdfkit/wiki/Installing-WKHTMLTOPDF\u003e\n\n## Usage\n```js\n// PDFKit support multiples types (url, file, html) and any options for wkhtmltopdf\n// run `wkhtmltopdf --extended-help` for a full list of options\nvar PDFKit = require('pdfkitjs');\n\npdf = new PDFKit('url', 'http://google.com');\n\npdf.toFile('google.pdf', function (err, file) {\n  console.log('File ' + file + ' written');\n});\n```\n\n## API\n\n### PDFKit(type, url_file_or_html[, options[, spawnOptions[, logger]]])\n\n`options` : Object corresponding on wkhtmltopdf arguments. run `wkhtmltopdf --extended-help` for a full list of options\n\n`spawnOptions` : Options passed to [`child_process.spawn`](http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) except `exec` who is the path to the wkhtmltopdf binary. (Default: `wkhtmltopdf`)\n\n* `url`\n```js\nnew PDFKit('url', 'http://google.com')\n```\n\n* `file`\n```js\nnew PDFKit('file', 'path/to/some.html')\n```\n\n* `html`\n```js\nnew PDFKit('html', '\u003ch1\u003eHello\u003c/h1\u003e')\n```\n\n\n### Logger\n\nYou can pass a logger object that implemnts `log`, `warn`, `debug` methods. Default logger:\n```js\nvar baseLogger = {\n  log: console.log,\n  warn: console.warn,\n  debug: console.log\n};\n```\n\nTo silent all logs, you can pass `false`.\n\n\n### Output\n\nTODO\n\n\n## Copyright\n\nCopyright (c) 2010 Loïc Mahieu.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floicmahieu%2Fpdfkitjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floicmahieu%2Fpdfkitjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floicmahieu%2Fpdfkitjs/lists"}