{"id":15061166,"url":"https://github.com/meafmira/bs-react-pdf","last_synced_at":"2026-03-14T21:21:14.870Z","repository":{"id":72875226,"uuid":"103546313","full_name":"meafmira/bs-react-pdf","owner":"meafmira","description":"react-pdf bindings for bucklescript","archived":false,"fork":false,"pushed_at":"2017-11-08T15:46:48.000Z","size":29,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T07:40:49.088Z","etag":null,"topics":["bs-react-pdf","bucklescript","ocaml","react","react-pdf","reason","reasonml"],"latest_commit_sha":null,"homepage":null,"language":"OCaml","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/meafmira.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}},"created_at":"2017-09-14T15:00:24.000Z","updated_at":"2021-07-05T02:13:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"d07a5463-ad4d-4529-ab18-cf6db35db6c9","html_url":"https://github.com/meafmira/bs-react-pdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meafmira%2Fbs-react-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meafmira%2Fbs-react-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meafmira%2Fbs-react-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meafmira%2Fbs-react-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meafmira","download_url":"https://codeload.github.com/meafmira/bs-react-pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704515,"owners_count":20982292,"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":["bs-react-pdf","bucklescript","ocaml","react","react-pdf","reason","reasonml"],"created_at":"2024-09-24T23:10:40.585Z","updated_at":"2025-10-15T05:37:15.703Z","avatar_url":"https://github.com/meafmira.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bs-react-pdf [![npm version](https://img.shields.io/npm/v/bs-react-pdf.svg?style=flat-square)](https://www.npmjs.com/package/bs-react-pdf)\n\n[react-pdf](https://github.com/diegomura/react-pdf) bindings for [bucklescript](https://bucklescript.github.io/bucklescript/)\n\n## Installation\n\n1. `$ npm i bs-react-pdf`\n2. Add `bs-react-pdf` to `bs-dependencies` section of your `bsconfig.json`\n\n## [Examples](https://github.com/meafmira/bs-react-pdf/tree/master/examples)\n### Document\n\n```reason\nopen ReactPdf.Core;\n\nlet styles =\n  StyleSheet.create({\n    \"page\": {\"flexDirection\": \"row\", \"backgroundColor\": \"#fff\"},\n    \"section\": {\"margin\": 10, \"padding\": 10, \"flexGrow\": 1}\n  });\n\nlet component = ReasonReact.reducerComponent(\"MyDocument\");\n\nlet make = (_children) =\u003e {\n  ...component,\n  reducer: ((), _state: unit) =\u003e ReasonReact.NoUpdate,\n  render: (_self) =\u003e\n    \u003cDocument\u003e\n      \u003cPage size=\"A4\" style=styles##page\u003e\n        \u003cView style=styles##section\u003e\n          \u003cText key=\"hello\"\u003e (ReasonReact.stringToElement(\"Section #1\")) \u003c/Text\u003e\n        \u003c/View\u003e\n        \u003cView style=styles##section\u003e\n          \u003cText\u003e (ReasonReact.stringToElement(\"Section #2\")) \u003c/Text\u003e\n        \u003c/View\u003e\n      \u003c/Page\u003e\n    \u003c/Document\u003e\n};\n```\n\n### Save in a file\n\n```reason\nReactPdfNode.render(\u003cMyDocument /\u003e, \"example.pdf\")\n|\u003e Js.Promise.then_(() =\u003e Js.Promise.resolve @@ Js.log(\"Pdf created\"));\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeafmira%2Fbs-react-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeafmira%2Fbs-react-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeafmira%2Fbs-react-pdf/lists"}