{"id":41394001,"url":"https://github.com/kryops/pdfmake-html-renderer","last_synced_at":"2026-01-31T15:02:24.998Z","repository":{"id":43641829,"uuid":"363369202","full_name":"kryops/pdfmake-html-renderer","owner":"kryops","description":"JavaScript/HTML renderer for pdfmake PDF document definition objects","archived":false,"fork":false,"pushed_at":"2026-01-18T07:09:06.000Z","size":64996,"stargazers_count":8,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-24T03:31:39.141Z","etag":null,"topics":["pdf","pdfmake"],"latest_commit_sha":null,"homepage":"https://kryops.github.io/pdfmake-html-renderer/","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/kryops.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2021-05-01T09:18:11.000Z","updated_at":"2026-01-11T14:25:17.000Z","dependencies_parsed_at":"2024-12-22T16:22:35.766Z","dependency_job_id":"3651d581-1bcf-4601-9139-e51c53f24f3f","html_url":"https://github.com/kryops/pdfmake-html-renderer","commit_stats":{"total_commits":74,"total_committers":2,"mean_commits":37.0,"dds":0.09459459459459463,"last_synced_commit":"8117f5218ab87aa2ddfadb47af0cce4d928d0986"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/kryops/pdfmake-html-renderer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kryops%2Fpdfmake-html-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kryops%2Fpdfmake-html-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kryops%2Fpdfmake-html-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kryops%2Fpdfmake-html-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kryops","download_url":"https://codeload.github.com/kryops/pdfmake-html-renderer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kryops%2Fpdfmake-html-renderer/sbom","scorecard":{"id":570900,"data":{"date":"2025-08-11","repo":{"name":"github.com/kryops/pdfmake-html-renderer","commit":"a81ee0e80eeba3fe6d4c17adf3e9a1afbd460d56"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":0,"reason":"49 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-4www-5p9h-95mh","Warn: Project is vulnerable to: GHSA-9gqv-wp59-fq42","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-g5m6-hxpp-fc49","Warn: Project is vulnerable to: GHSA-mh2x-fcqh-fmqv","Warn: Project is vulnerable to: GHSA-rjjv-87mx-6x3h","Warn: Project is vulnerable to: GHSA-6q87-84jw-cjhp","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-8266-84wp-wv5c","Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw","Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g","Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3","Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T16:19:32.743Z","repository_id":43641829,"created_at":"2025-08-20T16:19:32.743Z","updated_at":"2025-08-20T16:19:32.743Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28946070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["pdf","pdfmake"],"created_at":"2026-01-23T12:50:08.113Z","updated_at":"2026-01-31T15:02:24.981Z","avatar_url":"https://github.com/kryops.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pdfmake-html-renderer\n\nJavaScript/HTML renderer for [pdfmake](http://pdfmake.org) PDF document definition objects.\n\nPlayground: https://kryops.github.io/pdfmake-html-renderer/\n\n## What this library is for\n\n- **Seamlessly embedding** [pdfmake](http://pdfmake.org) document previews into web applications\n- **Fast preview** generation and incremental updates, e.g. for editor scenarios or frequent changes\n- **Lightweight** alternative to the full [pdfmake](http://pdfmake.org) when rendering document previews on the client (50-110KB minified compared to 2MB)\n\n## Limitations\n\n- **Paging** is not implemented: The document is rendered as a single page\n  - Header and footer are rendered at the very top and the very bottom\n  - Watermark and background are rendered only once at the top\n  - Elements positioned through `absolutePosition` are positioned in reference to the top\n  - Page references are rendered as `X`\n  - `linkToPage` properties are ignored\n  - The table of contents does not render page numbers\n  - Manual page breaks specified through `pageBreak` are rendered as a horizontal line\n  - `pageBreakBefore` is not implemented\n  - For short content, we enforce the height of a single page (unless `mode: 'fluid'` is set)\n- **Tiling patterns** are not supported\n- **Column widths** behave slightly differently, especially when combining `*` and `auto` widths\n- **Relative positioning** ignores the `alignment` property\n- **List markers** in ordered lists are right-aligned, while `pdfmake` aligns them to the left\n- **QR Codes** look slightly different to the ones created by `pdfmake`, and may be larger for some values of `fit`\n- **Attachments** are not displayed\n\n### Supported browsers\n\nCurrently, only evergreen browsers are supported explicitly (see `.browserslistrc`).\n\nIf you need to support older browsers with your application, you should be able to run this library through [Babel](https://babeljs.io/) as part of your build process and polyfill newer APIs through [core-js](https://github.com/zloirock/core-js).\n\nOn old browsers that do not support CSS variables, some styles may be broken.\n\n## Usage\n\n1. Install this package:\n\n```\nnpm install pdfmake-html-renderer\n```\n\n2. Add the CSS file:\n\n```js\nimport 'pdfmake-html-renderer/dist/index.css'\n```\n\n\u003e **NOTE**: For this to work, make sure your tooling/bundler supports importing CSS files. Otherwise, you can always use a `\u003clink rel=\"stylesheet\"\u003e` in your HTML file.\n\n3. _(Optional)_ Import fonts:\n\nAny fonts used in your PDF document definitions, including the default [Roboto](https://fonts.google.com/specimen/Roboto) font, should be imported using CSS [`@font-face`](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face) rules.\n\nTo use the version provided by [Google Fonts](https://fonts.google.com/), add the following HTML to your `\u003chead\u003e`:\n\n```html\n\u003clink rel=\"preconnect\" href=\"https://fonts.gstatic.com\" /\u003e\n\u003clink\n  href=\"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700\u0026display=swap\"\n  rel=\"stylesheet\"\n/\u003e\n```\n\nOtherwise, the renderer may use a fallback font depending on the fonts installed on the machine.\n\n4. If you have a Content Security Policy, you might need to extend it:\n\n- `style-src 'unsafe-inline'` as computed styles are set inline\n- `image-src data:` for images passed as data URL\n\n5. Integrate the component:\n\n```js\nimport PdfmakeHtmlRenderer from 'pdfmake-html-renderer'\n```\n\nThis library was built using the [Svelte](https://svelte.dev/) framework, which should allow integrating it into pretty much any web application:\n\n- To consume it from a [Svelte](https://svelte.dev/) application, you may have to add build tooling to support TypeScript into your pipeline, as Svelte needs to compile the components from source\n- For a [React](https://reactjs.org/) or [Vue.js](https://vuejs.org/) application, you can use an adapter like [`svelte-adapter`](https://github.com/pngwn/svelte-adapter)\n- For other frameworks or VanillaJS, have a look at the [Svelte Component API](https://svelte.dev/docs/client-side-component-api)\n\nCheck out the `/examples` folder for some example projects.\n\n\u003e **TIP**: If you don't need QR Code support, you can try and ignore the `qrcode` package in your build process / bundler. This will roughly cut this package's bundle size in half.\n\n### TypeScript support\n\nThis package provides TypeScript typings. They depend on the typings for `svelte` and `pdfmake`, which are not included as dependencies and need to be added manually:\n\n```\nnpm install -D svelte @types/pdfmake\n```\n\n### Node.js server-side rendering **[EXPERIMENTAL]**\n\nThis library also provides an **experimental** server build that renders static HTML and CSS:\n\n```js\nconst { PdfmakeHtmlRenderer } = require('pdfmake-html-renderer/server')\n\nconst { html, css } = PdfmakeHtmlRenderer.render({\n  document: { content: ['Hello, world!'] },\n})\n\n// html contains the HTML code\n// css.code contains the CSS code\n```\n\nCheck out `/examples/nodejs` for an exmaple.\n\nRendering on the server comes with some additional limitations:\n\n- QR codes are not supported\n- Zooming / shrinking the page does not work\n- Relative positioning may not always be placed correctly\n\n## Options / Props\n\n### `document: TDocumentDefinitions`\n\nThe pdfmake document definition\n\n### `pageShadow?: boolean`\n\nWhether or not to display a shadow around the page.\n\nDefaults to `true`\n\n### `mode?: 'shrinkToFit' | 'zoomToFit' | 'natural' | 'fluid'`\n\nRendering / sizing mode\n\n- `shrinkToFit` _(default)_: Shrinks the document to fit in its container,\n  but does not grow beyond the document's natural size\n- `zoomToFit`: Shrinks or grows the document to fit in its container\n- `natural`: Renders the document in its exact natural size\n- `fluid`: Ignores the document's `pageSize` and uses the space available in the container\n\nWhen the `document` definition does not specify a `pageSize` property,\nthe standard size `'A4'` is assumed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkryops%2Fpdfmake-html-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkryops%2Fpdfmake-html-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkryops%2Fpdfmake-html-renderer/lists"}