{"id":15465520,"url":"https://github.com/gr2m/dream-pdf","last_synced_at":"2025-10-20T08:26:08.925Z","repository":{"id":66016641,"uuid":"36130382","full_name":"gr2m/dream-pdf","owner":"gr2m","description":"A modular JavaScript library to create PDFs","archived":false,"fork":false,"pushed_at":"2021-03-05T06:40:22.000Z","size":27,"stargazers_count":11,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-26T00:40:13.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-05-23T15:52:57.000Z","updated_at":"2024-03-21T18:29:36.000Z","dependencies_parsed_at":"2023-07-12T13:30:17.118Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/dream-pdf","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.05882352941176472,"last_synced_commit":"0ba0118a22c32e4d2e36ee6331165a41d4434eb8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gr2m/dream-pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fdream-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fdream-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fdream-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fdream-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/dream-pdf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fdream-pdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280053390,"owners_count":26264358,"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-10-20T02:00:06.978Z","response_time":62,"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-02T01:01:36.547Z","updated_at":"2025-10-20T08:26:08.893Z","avatar_url":"https://github.com/gr2m.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dream-pdf\n\n\u003e A modular JavaScript library to create PDFs\n\n[![Build Status](https://travis-ci.org/gr2m/dream-pdf.svg?branch=master)](https://travis-ci.org/gr2m/dream-pdf)\n[![Coverage Status](https://coveralls.io/repos/gr2m/dream-pdf/badge.svg?branch=master)](https://coveralls.io/r/gr2m/dream-pdf?branch=master)\n[![Dependency Status](https://david-dm.org/gr2m/dream-pdf.svg)](https://david-dm.org/gr2m/dream-pdf)\n[![devDependency Status](https://david-dm.org/gr2m/dream-pdf/dev-status.svg)](https://david-dm.org/gr2m/dream-pdf#info=devDependencies)\n\n[![NPM](https://nodei.co/npm/dream-pdf.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/dream-pdf/)\n\n## Motivations\n\n- Create PDFs with the same APIs in both browsers and Node.js\n- Tiny core, many plugins\n- low barrier of entry for contributors (e.g. full test coverage)\n\n## API\n\n```js\nvar DreamPDF = require('dream-pdf')\nvar doc = new DreamPDF(/* options */)\n\ndoc.add('Hello, DreamPDF reader!')\ndoc.getContent(function(error, content) {\n  // content can be written to file, or turned\n  // into a data-url. It's out of scope for dream-pdf core.\n\n  // Browser Example:\n  // var dataUrl = 'data:application/pdf;base64,' + btoa(content)\n  // Node Example:\n  // fs.writeFileSync('my.pdf', new Buffer(content, 'binary'))\n})\n```\n\n### Plugins\n\nBy default, `dream-pdf` only supports adding text.\n\n```js\ndoc.add('Hello, PDF reader!')\n```\n\nWhich is just a shortcut for\n\n```js\ndoc.add({ type: 'text', content: 'Hello, PDF reader!' })\n```\n\nTo add other things than 'text' to your PDF, a plugin\nneeds to be registered that handles the types.\n\n```js\n// register new plugins\nDreamPDF.plugin({\n  'image': require('dream-pdf-image'),\n  'password': require('dream-pdf-password')\n})\n// start new PDF and add objects with\n// type matching the keys above\nvar doc = new DreamPDF(/* options */)\npdf.add({\n  type: 'image',\n  path: './path/to/image.png'\n})\npdf.add({\n  type: 'password',\n  content: 'secret'\n})\n```\n\n## Resources\n\n- Official specifications: https://www.adobe.com/devnet/pdf/pdf_reference_archive.html\n- Twitter thread with great slide decks and cheat sheets: https://mobile.twitter.com/angealbertini/status/1194219247112785920\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fdream-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Fdream-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fdream-pdf/lists"}