How to Generate PDFs from SlickGrid with jsPDF
Export SlickGrid Universal data to PDF with jsPDF. Install the export service, register it with the grid, configure the output, and troubleshoot common issues.

Direct answer: For SlickGrid Universal, use its opt-in @slickgrid-universal/pdf-export package. It creates PDFs with jsPDF. Install the package, create a PdfExportService, register that service in the grid’s externalResources, enable PDF export in the grid options, then call exportToPdf. The optional jspdf-autotable package adds a richer table layout; without it, the documented fallback is a simple text-based layout. The exact setup can vary by installed release, so check that release’s package documentation before wiring it into a framework. [Package README]
This guide covers the SlickGrid Universal export service and the choices you need to make around layout, options, framework integration, and troubleshooting. The base 6pac SlickGrid project is a JavaScript grid; this documented export service belongs to SlickGrid Universal. Installing base SlickGrid alone does not provide this service. The base project points users who want framework wrappers toward SlickGrid Universal. [6pac SlickGrid]
1. Check which SlickGrid project you use
Before installing anything, confirm the grid package in your application. The instructions below are for SlickGrid Universal and its @slickgrid-universal/pdf-export package. If your app uses the base 6pac SlickGrid project, do not assume that PdfExportService or the Grid Menu command described here is available there. You can either move to the relevant SlickGrid Universal integration or implement PDF generation yourself with jsPDF and your own data-to-table mapping.
Also check the framework wrapper and package versions already in your project. The documentation establishes the service pattern, but does not establish compatibility for every framework and version combination. Use the imports and lifecycle conventions for the version you have installed; avoid copying imports from a different major release without checking its documentation.
2. Install the PDF export package
Install the export package in the application that owns the SlickGrid Universal instance:
npm install @slickgrid-universal/pdf-export
For an enhanced table with borders, padding, and per-column styles, also install AutoTable:
npm install jspdf-autotable
AutoTable is optional. The service uses it when detected. Without it, the package documents a simpler text-based PDF layout. Choose the optional dependency if table structure and per-column styling are important to your export; skip it when the fallback layout meets your needs or you want to keep the dependency set smaller.
The service uses jsPDF to generate the document. The package describes itself as exporting SlickGrid data to PDF using jsPDF. [Package README]
3. Register the service and configure the grid
Create one service instance for the grid, pass it through externalResources, and enable PDF export in the grid options. The package’s documented pattern looks like this:
import { PdfExportService } from '@slickgrid-universal/pdf-export';
import { jsPDF } from 'jspdf';
import { applyPlugin } from 'jspdf-autotable';
// Only needed when jspdf-autotable is installed.
// Register the plugin once during application startup.
applyPlugin(jsPDF);
const pdfExportService = new PdfExportService();
const gridOptions = {
enablePdfExport: true,
pdfExportOptions: {
filename: 'my-grid-export',
pageOrientation: 'landscape',
pageSize: 'a4',
documentTitle: 'My Grid Data'
},
externalResources: [pdfExportService]
};
If AutoTable is not installed, remove its import and applyPlugin call. Do not leave an import for an optional dependency that your build does not include. Register AutoTable once at startup rather than once per export. The externalResources registration matters: enabling an option alone does not create the service instance the grid needs.
In framework applications, place service creation where the grid instance is configured, following that wrapper’s lifecycle. If the grid options are rebuilt, preserve the service registration in the options passed to the active grid. The package example is not a guarantee that the same lifecycle code works unchanged in every framework.
4. Export from code or use the Grid Menu
Once registered, call the service directly when you want to trigger an export from an application action:

await pdfExportService.exportToPdf({
filename: 'custom-export',
pageOrientation: 'portrait'
});
The grid option interface documents enablePdfExport as enabling the PDF export command in the Grid Menu. This gives users a grid-level menu action, while the service call gives your application a programmatic trigger. [Grid option interface]
Use the Grid Menu when the user should decide when to download the current grid export. Call exportToPdf from an application button or workflow when export is part of a larger task. If both entry points are exposed, keep their settings aligned so that the menu and application action do not create unexpectedly different files.
5. Choose page and document settings
The documented configuration includes a filename, page size, orientation, and document title. The package README also advertises grouped data, page sizes such as A4, Letter, and Legal, font sizes, formatters, HTML entity decoding, sanitization, per-column alignment, grouped column headers, header and alternate-row colors, and PDF metadata. Treat these as package capabilities, then verify the precise option names and supported values in the version installed in your app. [Package README]
| Setting or capability | What to decide | Practical check |
|---|---|---|
filename |
What downloaded file name should users see? | Set a stable, descriptive name and confirm whether the package appends the PDF extension. |
pageOrientation |
Portrait or landscape? | Use landscape as a starting point for grids with many columns; verify that labels and values remain readable. |
pageSize |
Which paper format fits the intended use? | Check supported names for your version. The README mentions A4, Letter, and Legal. |
documentTitle and metadata |
What information should identify the document? | Use a title that makes sense when the file is opened or archived. |
| Fonts and colors | How should headers and alternate rows appear? | Check the available options and render a representative export before shipping a style change. |
| Formatters and grouped headers | Should the PDF reflect grid formatting or group structure? | Verify how the installed release handles formatted values, grouped data, and column groups. |
| Alignment and sanitization | How should values line up, and how should text be handled? | Confirm per-column alignment and sanitization behavior for the actual data you export. |
Do not assume a particular default, enum spelling, or metadata field beyond what your installed package’s types and documentation state. The interface and README can evolve independently of older examples. If TypeScript rejects a documented-looking option, use the installed package’s declarations as the authority for that installation.
6. Decide between AutoTable and the fallback
AutoTable is useful when the output should read as a recognizable table, with cell borders, padding, and per-column styles. It is an optional enhancement, not a prerequisite for producing a PDF. The documented fallback is a simple text-based layout.
- Use AutoTable when column structure and table styling are central to the document.
- Try the fallback when a basic text layout is sufficient and the optional dependency is not present.
- Compare both in your target release if bundle size, layout, or rendering differences matter. The source describes the fallback and enhanced route, but does not provide a universal performance comparison.
When the PDF will be shared outside the application, inspect its output with realistic column counts and long values. A layout that works with a small development dataset may become cramped with production-shaped rows.
7. A custom jsPDF implementation
A custom implementation is another route if you need layout behavior the package does not expose. In that design, your application owns the mapping from grid data and column definitions into jsPDF drawing calls or an AutoTable input structure. You also own pagination, formatting, header behavior, and keeping the implementation aligned with your installed jsPDF and optional plugin versions.
The collected package sources establish the dedicated SlickGrid Universal service, but do not document a complete custom implementation or quantify its maintenance cost. Choose custom generation only when you need control beyond the documented service, and treat it as application code that needs its own compatibility and output review. Do not assume base SlickGrid offers the Universal service API.
8. Troubleshooting common problems
| Symptom | Likely cause | What to do |
|---|---|---|
| The PDF command is missing from Grid Menu | PDF export is not enabled, or the service is not registered with the active grid options. | Confirm enablePdfExport: true and that externalResources includes the PdfExportService instance. |
PdfExportService cannot be imported |
The export package is not installed, or the app uses base SlickGrid rather than SlickGrid Universal. | Check the dependency and project identity. Install the Universal export package only in a compatible Universal setup. |
| AutoTable import or plugin registration fails | jspdf-autotable is absent, or its setup does not match the installed versions. |
Install the optional package and follow its version’s registration pattern. Otherwise remove the import and use the documented fallback. |
| A TypeScript option is rejected | An example may target another package release, or an option name/value may differ. | Inspect the installed package’s type declarations and README; adjust to that release rather than suppressing the type error. |
| The PDF layout is too plain | The optional table renderer may not be installed or detected. | Confirm AutoTable is installed and registered. Check the output again; the fallback is documented as text-based. |
| Columns or values are difficult to read | The chosen paper size, orientation, font sizing, or data width may not suit the grid. | Try landscape or another supported page size; review font and column alignment options and test long values. |
| Export behavior differs from the screen | Screen formatting, grouped headers, formatters, or sanitization may be configured differently from the export. | Review the export options available in the installed release and validate representative formatted and grouped data. |
| Works in one framework wrapper but not another | Service initialization or grid lifecycle integration differs, or package versions are mismatched. | Follow the wrapper’s lifecycle conventions and verify package compatibility for the versions actually installed. |
9. Performance, reliability, and cost
PDF creation runs as part of your application’s export flow. The available sources do not provide benchmark figures, memory limits, or a universal row-count threshold, so measure with your own dataset and target browser rather than relying on an invented cutoff. Check both the time users wait and the resulting document’s usability.
- Try realistic data: include the number of rows and columns users actually export, plus long formatted values.
- Review output after configuration changes: page size, orientation, fonts, formatters, and table rendering all affect the result.
- Keep versions aligned: record the SlickGrid Universal, jsPDF, and optional AutoTable versions in the application dependency set.
- Handle export as an explicit action: give users a clear trigger and feedback consistent with your app if generation takes noticeable time.
- Budget dependencies: AutoTable adds an optional package; compare its layout benefit against the extra dependency and the simpler fallback.
There is no per-export service charge described in the cited package documentation; this route uses application dependencies. Your actual cost considerations are engineering time, dependency maintenance, and how much export-specific layout your app must own. The sources do not establish a pricing or performance comparison between this package and custom jsPDF code.
10. Or skip the browser setup
If your task is capturing a website as a PDF, rather than exporting the structured rows of a SlickGrid, ScreenshotNeo provides a one-request screenshot and PDF API. It is a different job from a grid data export: use SlickGrid’s service when you need grid data and tabular document options; use a page capture when you need a rendered webpage.

One cURL request can capture a page as PDF:
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://stripe.com \
-d format=pdf \
-o page.pdf
See the ScreenshotNeo API documentation for request parameters. The API accepts a URL and returns a clean screenshot as PNG, JPEG, or WebP, or a PDF. Cookie banners, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with the response identifying the page verdict and billing status in headers. Its MCP server gives AI agents tools for screenshots, page info, and PDF capture. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.
Get 1,000 free screenshots a month, with no card.
Frequently asked questions
Does this work with the original 6pac SlickGrid?
The documented @slickgrid-universal/pdf-export service is for SlickGrid Universal. The sources do not say that base 6pac SlickGrid includes it. Check which project your app uses before following the service setup.
Is jspdf-autotable required?
No. It is optional. The package documents a simple text-based fallback when AutoTable is not detected.
Can I export without showing a menu item?
The service example calls exportToPdf directly. The documented Grid Menu command is enabled with enablePdfExport; use the direct call when triggering export from your own application action.
Where can I confirm exact option names?
Check the README and types for the version installed in your project. The listed capabilities are documented by the package, but exact types and behavior can vary by release.
Can ScreenshotNeo export SlickGrid rows?
ScreenshotNeo captures rendered web pages as images or PDFs. It does not replace the SlickGrid data-export service when you need a PDF built from structured grid rows and their export configuration.


