{"id":15415760,"url":"https://github.com/inokawa/remark-pdf","last_synced_at":"2026-01-27T03:11:39.763Z","repository":{"id":45696244,"uuid":"446009723","full_name":"inokawa/remark-pdf","owner":"inokawa","description":"remark plugin to compile markdown to pdf.","archived":false,"fork":false,"pushed_at":"2026-01-19T16:49:09.000Z","size":32298,"stargazers_count":41,"open_issues_count":10,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-19T17:11:46.867Z","etag":null,"topics":["markdown","mdast","pandoc","pdf","remark","remark-plugin","unified"],"latest_commit_sha":null,"homepage":"https://inokawa.github.io/remark-pdf/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inokawa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["inokawa"]}},"created_at":"2022-01-09T06:16:22.000Z","updated_at":"2026-01-19T16:48:40.000Z","dependencies_parsed_at":"2023-11-28T01:29:14.747Z","dependency_job_id":"d321eec1-0a99-48c1-8a51-5967df0ecbc6","html_url":"https://github.com/inokawa/remark-pdf","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"14d7a9c91d938228802fbebf855b4df434eb0fa0"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/inokawa/remark-pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inokawa%2Fremark-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inokawa%2Fremark-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inokawa%2Fremark-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inokawa%2Fremark-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inokawa","download_url":"https://codeload.github.com/inokawa/remark-pdf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inokawa%2Fremark-pdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28798675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["markdown","mdast","pandoc","pdf","remark","remark-plugin","unified"],"created_at":"2024-10-01T17:09:33.193Z","updated_at":"2026-01-27T03:11:39.720Z","avatar_url":"https://github.com/inokawa.png","language":"TypeScript","funding_links":["https://github.com/sponsors/inokawa"],"categories":[],"sub_categories":[],"readme":"# remark-pdf\n\n![npm](https://img.shields.io/npm/v/remark-pdf) ![npm](https://img.shields.io/npm/dw/remark-pdf) ![check](https://github.com/inokawa/remark-pdf/workflows/check/badge.svg) ![demo](https://github.com/inokawa/remark-pdf/workflows/demo/badge.svg)\n\n\u003e [remark](https://github.com/remarkjs/remark) plugin to compile markdown to pdf.\n\n- Uses [pdfkit](https://github.com/foliojs/pdfkit) for compilation, to avoid issues with puppeteer or headless chromium.\n- Works in any environment (e.g. browser, Node.js).\n- Generates [PDF/A-3A](https://en.wikipedia.org/wiki/PDF/A) compliant document for accessibility.\n- Supports configuration of page layout, fonts and styles.\n\n### Supported [mdast](https://github.com/syntax-tree/mdast) nodes\n\nCurrently, some of the default styles may not be nice. If you have some feature requests or improvements, please create a [issue](https://github.com/inokawa/remark-pdf/issues) or [PR](https://github.com/inokawa/remark-pdf/pulls).\n\n- [x] paragraph\n- [x] heading\n- [x] thematicBreak\n- [x] blockquote\n- [x] list / listItem\n- [x] table / tableRow / tableCell\n- [x] definition\n- [x] text\n- [x] emphasis\n- [x] strong\n- [x] delete\n- [x] inlineCode\n- [x] break\n- [x] link / linkReference\n- [ ] footnoteReference / footnoteDefinition\n- [x] image / imageReference\n- [ ] html\n- [x] code\n- [ ] math / inlineMath\n\n## Demo\n\nhttps://inokawa.github.io/remark-pdf/\n\n## Install\n\n```sh\nnpm install remark-pdf\n```\n\n## Usage\n\n### Browser\n\n```javascript\nimport { unified } from \"unified\";\nimport markdown from \"remark-parse\";\nimport pdf from \"remark-pdf\";\nimport { saveAs } from \"file-saver\";\n\nconst processor = unified().use(markdown).use(pdf);\n\nconst text = \"# hello world\";\n\n(async () =\u003e {\n  const doc = await processor.process(text);\n  const arrayBuffer = await doc.result;\n  saveAs(new Blob([arrayBuffer], { type: \"application/pdf\" }), \"example.pdf\");\n})();\n```\n\n### Node.js\n\n```javascript\nimport { unified } from \"unified\";\nimport markdown from \"remark-parse\";\nimport pdf from \"remark-pdf\";\nimport * as fs from \"fs\";\n\nconst processor = unified().use(markdown).use(pdf);\n\nconst text = \"# hello world\";\n\n(async () =\u003e {\n  const doc = await processor.process(text);\n  const arrayBuffer = await doc.result;\n  fs.writeFileSync(\"example.pdf\", Buffer.from(arrayBuffer));\n})();\n```\n\n#### Example: Custom fonts\n\nUse custom fonts by providing a `fonts` option. Use the fonts by name in your `styles` configurations; the font file will be autoselected based on the chosen `bold` and `italic` style specifications.\n\nNote that variable-width fonts are supported, but the path to the same font file must be supplied for all four font variant styles.\n\n```javascript\nimport { unified } from \"unified\";\nimport markdown from \"remark-parse\";\nimport pdf from \"remark-pdf\";\nimport * as fs from \"fs\";\n\nconst processor = unified()\n  .use(markdown)\n  .use(pdf, {\n    fonts: [\n      {\n        name: \"National Park\",\n        normal: fs.readFileSync(\"/path/to/fonts/nationalpark-variablevf.ttf\"),\n        bold: fs.readFileSync(\"/path/to/fonts/nationalpark-variablevf.ttf\"),\n        italic: fs.readFileSync(\"/path/to/fonts/nationalpark-variablevf.ttf\"),\n        bolditalic: fs.readFileSync(\n          \"/path/to/fonts/nationalpark-variablevf.ttf\",\n        ),\n      },\n      {\n        name: \"Merriweather Sans\",\n        normal: fs.readFileSync(\"/path/to/fonts/merriweathersans-light.ttf\"),\n        bold: fs.readFileSync(\"/path/to/fonts/merriweathersans-bold.ttf\"),\n        italic: fs.readFileSync(\"/path/to/fonts/merriweathersans-italic.ttf\"),\n        bolditalic: fs.readFileSync(\n          \"/path/to/fonts/merriweathersans-bolditalic.ttf\",\n        ),\n      },\n    ],\n    styles: {\n      default: { font: \"Merriweather Sans\", italic: true },\n      head1: {\n        bold: true,\n        font: \"National Park\",\n        fontSize: 24,\n      },\n    },\n  });\n\nconst text = `\n# Header in National Park bold\n\nBody text in Merriweather Sans Italic\n`;\n\n(async () =\u003e {\n  const doc = await processor.process(text);\n  const arrayBuffer = await doc.result;\n  fs.writeFileSync(\"example.pdf\", Buffer.from(arrayBuffer));\n})();\n```\n\n## Documentation\n\n- [API reference](./docs/API.md)\n\n## Contribute\n\nAll contributions are welcome.\nIf you find a problem, feel free to create an [issue](https://github.com/inokawa/remark-pdf/issues) or a [PR](https://github.com/inokawa/remark-pdf/pulls).\n\n### Making a Pull Request\n\n1. Fork this repo.\n2. Run `npm install`.\n3. Commit your fix.\n4. Add tests to cover the fix.\n5. Make a PR and confirm all the CI checks passed.\n\n## Related projects\n\n- [remark-slate-transformer](https://github.com/inokawa/remark-slate-transformer)\n- [remark-docx](https://github.com/inokawa/remark-docx)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finokawa%2Fremark-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finokawa%2Fremark-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finokawa%2Fremark-pdf/lists"}