{"id":50622361,"url":"https://github.com/revolist/revogrid-pdf-export","last_synced_at":"2026-06-06T13:02:19.342Z","repository":{"id":362749240,"uuid":"1260568787","full_name":"revolist/revogrid-pdf-export","owner":"revolist","description":"Clean, fast, powerful pdf export for RevoGrid Data Grid","archived":false,"fork":false,"pushed_at":"2026-06-05T18:27:02.000Z","size":32022,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T19:22:24.804Z","etag":null,"topics":["data-grid","data-table","datagrid","export","export-to-pdf","pdf","pdf-export","pdfmake","reporting"],"latest_commit_sha":null,"homepage":"https://rv-grid.com","language":"TypeScript","has_issues":false,"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/revolist.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-05T16:23:42.000Z","updated_at":"2026-06-05T18:26:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/revolist/revogrid-pdf-export","commit_stats":null,"previous_names":["revolist/revogrid-pdf-export"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/revolist/revogrid-pdf-export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolist%2Frevogrid-pdf-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolist%2Frevogrid-pdf-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolist%2Frevogrid-pdf-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolist%2Frevogrid-pdf-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revolist","download_url":"https://codeload.github.com/revolist/revogrid-pdf-export/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolist%2Frevogrid-pdf-export/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33983046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"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":["data-grid","data-table","datagrid","export","export-to-pdf","pdf","pdf-export","pdfmake","reporting"],"created_at":"2026-06-06T13:02:08.531Z","updated_at":"2026-06-06T13:02:19.334Z","avatar_url":"https://github.com/revolist.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eRevoGrid PDF Export\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Export \u003ca href=\"https://rv-grid.com/\"\u003eRevoGrid\u003c/a\u003e data to clean, shareable PDF files with a small browser-side plugin powered by \u003ca href=\"https://pdfmake.github.io/docs/\"\u003epdfmake\u003c/a\u003e.\n\u003c/p\u003e\n\n![RevoGrid PDF Export preview](assets/preview.png)\n\n[`@revolist/revogrid-pdf-export`](https://www.npmjs.com/package/@revolist/revogrid-pdf-export) is built for teams that need a practical PDF export button without bringing in a heavy reporting stack. It reads visible [RevoGrid](https://github.com/revolist/revogrid) data, preserves column headers, respects trimmed or filtered rows, and creates a simple [pdfmake document definition](https://pdfmake.github.io/docs/0.1/document-definition-object/) that is ready to download, preview, or customize.\n\n## Why Use It\n\n- Lightweight client-side PDF export for [RevoGrid](https://rv-grid.com/).\n- Works with the standard [RevoGrid plugin API](https://rv-grid.com/guide/plugin/).\n- Exports visible rows and visible columns.\n- Supports grouped column headers.\n- Lets you download a PDF, return a browser [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob), or access the [pdfmake document definition](https://pdfmake.github.io/docs/0.1/document-definition-object/).\n- Provides a cancelable `beforepdfexport` hook for last-mile customization.\n- Keeps the first version intentionally focused: fast to adopt, easy to understand, and simple to extend.\n\n## Install\n\n```sh\nnpm install @revolist/revogrid-pdf-export\n```\n\n## Quick Start\n\n```ts\nimport { ExportPdfPlugin } from '@revolist/revogrid-pdf-export';\n\ngrid.plugins = [ExportPdfPlugin];\n\nconst plugins = await grid.getPlugins();\nconst pdf = plugins.find(plugin =\u003e plugin instanceof ExportPdfPlugin);\n\nawait pdf?.exportPdf({\n  filename: 'orders.pdf',\n  title: 'Orders',\n});\n```\n\n## API\n\n### `exportPdf(options?)`\n\nCreates and downloads a PDF file.\n\n```ts\nawait pdf.exportPdf({\n  filename: 'orders.pdf',\n  title: 'Orders Report',\n});\n```\n\n### `exportBlob(options?)`\n\nCreates a PDF and returns it as a browser `Blob`. Use this when you want to upload, preview, or handle the file yourself.\n\n```ts\nconst blob = await pdf.exportBlob({\n  title: 'Orders Report',\n});\n```\n\n### `getDocumentDefinition(options?)`\n\nReturns the [pdfmake document definition](https://pdfmake.github.io/docs/0.1/document-definition-object/) before a PDF is created. This is useful when you want full control over rendering.\n\n```ts\nconst definition = await pdf.getDocumentDefinition({\n  pageOrientation: 'portrait',\n});\n```\n\n## Options\n\n| Option | Type | Default | Description |\n| --- | --- | --- | --- |\n| `filename` | `string` | `revogrid-export.pdf` | Download filename. `.pdf` is added automatically when omitted. |\n| `title` | `string` | `RevoGrid Export` | Title shown above the exported table. |\n| `pageOrientation` | `'portrait' \\| 'landscape'` | `landscape` | PDF page orientation. |\n| `includeColumnHeaders` | `boolean` | `true` | Includes the column header row. |\n| `includeGroupHeaders` | `boolean` | `true` | Includes grouped column header rows when present. |\n| `maxRows` | `number` | unlimited | Limits exported data rows. |\n| `tableLayout` | `string` | `lightHorizontalLines` | [pdfmake table layout](https://pdfmake.github.io/docs/0.1/document-definition-object/tables/) name. |\n\n## Customization\n\nThe plugin emits a cancelable `beforepdfexport` event with `{ data, documentDefinition, options }`.\n\nUse it to adjust the [pdfmake document definition](https://pdfmake.github.io/docs/0.1/document-definition-object/), add metadata, change styles, or stop the export.\n\n```ts\ngrid.addEventListener('beforepdfexport', event =\u003e {\n  event.detail.documentDefinition.info = {\n    title: 'Orders Report',\n    subject: 'Monthly order export',\n  };\n\n  event.detail.documentDefinition.footer = currentPage =\u003e ({\n    text: `Page ${currentPage}`,\n    alignment: 'center',\n    fontSize: 8,\n  });\n});\n```\n\nCall `event.preventDefault()` to cancel the export.\n\n## What Gets Exported\n\nThe plugin focuses on data, not pixel-perfect rendering. It exports:\n\n- visible row data\n- visible columns\n- column names\n- grouped column headers\n- filtered or trimmed grid state through RevoGrid's visible source APIs\n\nIt does not attempt to reproduce custom cell renderers, DOM styling, images, row headers, pinned layout visuals, or editor UI. This keeps the plugin small and predictable.\n\n## Frameworks\n\nThe plugin is framework-agnostic. Use it anywhere you can pass RevoGrid plugins:\n\n- [Vanilla JavaScript / TypeScript](https://rv-grid.com/guide/ts/)\n- [React](https://rv-grid.com/guide/react/)\n- [Vue](https://rv-grid.com/guide/vue3/)\n- [Angular](https://rv-grid.com/guide/angular/)\n- [Svelte](https://rv-grid.com/guide/svelte/)\n\n## Links\n\n- [RevoGrid website](https://rv-grid.com/)\n- [RevoGrid GitHub](https://github.com/revolist/revogrid)\n- [RevoGrid PDF Export GitHub](https://github.com/revolist/revogrid-pdf-export)\n- [pdfmake documentation](https://pdfmake.github.io/docs/)\n- [npm package](https://www.npmjs.com/package/@revolist/revogrid-pdf-export)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevolist%2Frevogrid-pdf-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevolist%2Frevogrid-pdf-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevolist%2Frevogrid-pdf-export/lists"}