{"id":16014932,"url":"https://github.com/thheller/reagent-pdfjs","last_synced_at":"2025-07-27T03:06:04.123Z","repository":{"id":51096961,"uuid":"369281892","full_name":"thheller/reagent-pdfjs","owner":"thheller","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-25T07:45:37.000Z","size":27,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T11:51:28.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/thheller.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-20T17:06:02.000Z","updated_at":"2024-03-22T00:08:38.000Z","dependencies_parsed_at":"2024-10-27T17:24:04.488Z","dependency_job_id":null,"html_url":"https://github.com/thheller/reagent-pdfjs","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"011b0d7ceeac7f0453d68fc97d4431a0d8ee22c0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thheller/reagent-pdfjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thheller%2Freagent-pdfjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thheller%2Freagent-pdfjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thheller%2Freagent-pdfjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thheller%2Freagent-pdfjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thheller","download_url":"https://codeload.github.com/thheller/reagent-pdfjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thheller%2Freagent-pdfjs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267293762,"owners_count":24065321,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"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":[],"created_at":"2024-10-08T15:05:34.375Z","updated_at":"2025-07-27T03:06:04.105Z","avatar_url":"https://github.com/thheller.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reagent-pdfjs\n\nQuick example showing how to use [pdf.js](https://mozilla.github.io/pdf.js/) with [reagent](https://github.com/reagent-project/reagent) in CLJS. This isn't specific to reagent so any React wrapper will work as long as function components are supported. This could be rewritten to not use hooks too.\n\nI adapted the basic [Hello World Example](https://mozilla.github.io/pdf.js/examples/) directly from the `pdf.js` homepage.\n\nI opted to use the CDN prebuilt distribution and not the `npm` package since that often seems to be several versions behind. It is also easier to deal with the \"worker\" pdf.js uses which is a pre-built `.js` file which would otherwise need to be copied manually from `node_modules/pdfjs-dist`.\n\n```\ngit clone https://github.com/thheller/reagent-pdfjs.git\ncd reagent-pdfjs\nnpm install\nnpx shadow-cljs watch demo\n```\n\nWait for \"Build completed.\" and open `http://localhost:8400` in your Browser. You should see a \"Hello World\" pdf displayed.\n\nThis example shows how to use React `useRef` in combination with `useEffect` to interop with foreign DOM libraries that don't use the React/reagent rendering model. It applies to many other libraries (eg. d3) in the same way. Create a DOM node, add a ref and use that via within the `useEffect` callback. Sometimes it may be necessary to \"clean up\" after yourself in that hook. Couldn't find anything about that in the pdf.js docs, so I only added a log where you'd do it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthheller%2Freagent-pdfjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthheller%2Freagent-pdfjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthheller%2Freagent-pdfjs/lists"}