{"id":27432229,"url":"https://github.com/joshua-gould/canvas2pdf","last_synced_at":"2025-04-14T16:19:04.808Z","repository":{"id":51387895,"uuid":"100406655","full_name":"joshua-gould/canvas2pdf","owner":"joshua-gould","description":"Export your HTML canvas to PDF","archived":false,"fork":false,"pushed_at":"2024-01-10T22:00:20.000Z","size":2524,"stargazers_count":225,"open_issues_count":5,"forks_count":39,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T16:18:56.050Z","etag":null,"topics":["canvas","canvas-context","html-canvas","javascript","node-canvas","nodejs","pdf","pdfkit"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/joshua-gould.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-08-15T18:24:09.000Z","updated_at":"2025-04-08T05:59:02.000Z","dependencies_parsed_at":"2024-06-18T19:59:50.775Z","dependency_job_id":"fd802334-e506-43da-8647-026dacb0fa43","html_url":"https://github.com/joshua-gould/canvas2pdf","commit_stats":{"total_commits":23,"total_committers":3,"mean_commits":7.666666666666667,"dds":"0.13043478260869568","last_synced_commit":"cd42b064393e92713949bdfb2a141547f4031d51"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshua-gould%2Fcanvas2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshua-gould%2Fcanvas2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshua-gould%2Fcanvas2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshua-gould%2Fcanvas2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshua-gould","download_url":"https://codeload.github.com/joshua-gould/canvas2pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248914118,"owners_count":21182359,"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":["canvas","canvas-context","html-canvas","javascript","node-canvas","nodejs","pdf","pdfkit"],"created_at":"2025-04-14T16:19:04.360Z","updated_at":"2025-04-14T16:19:04.799Z","avatar_url":"https://github.com/joshua-gould.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Canvas2PDF\n\nCanvas2PDF exports your HTML canvas as PDF using JavaScript.\nNote that this library generates actual PDF drawing calls to create a PDF with vector graphics,\nunlike some alternate libraries which rasterize your canvas and place it as an image in your PDF.\n\n## Usage\n\n```javascript\nimport PdfContext from \"/src/canvas2pdf\";\nimport blobStream from \"blob-stream\";\nimport { saveAs } from \"file-saver\";\n\n// Create a new PDF canvas context.\nconst ctx = new PdfContext(blobStream());\n\n// draw your canvas like you would normally\nctx.fillStyle = \"yellow\";\nctx.fillRect(100, 100, 100, 100);\n// more canvas drawing, etc...\n\n// convert your PDF to a Blob and save to file\nctx.stream.on(\"finish\", function () {\n  const blob = ctx.stream.toBlob(\"application/pdf\");\n  saveAs(blob, \"example.pdf\", true);\n});\nctx.end();\n```\n\n## Interactive Browser Demo\n\n[Open Demo](https://joshua-gould.github.io/canvas2pdf/dist/index.html)\n\n## Notes\n\n- Calling fill and then stroke consecutively only executes fill\n- Some canvas 2d context methods are not implemented yet (e.g. arcTo)\n\n## License\n\nMIT\n\n## Developer Dependencies\n\n- GraphicsMagick is required for running tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshua-gould%2Fcanvas2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshua-gould%2Fcanvas2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshua-gould%2Fcanvas2pdf/lists"}