In this blogpost we will show you how to export AG Grid to PDF using the PDF document generation library  pdfMake.

We’ve implemented this PDF export capability in JavaScript, React, Angular and Vue so you can easily integrate this in your projects and start exporting your AG Grids to PDF!

In the live demo below there are two configuration panels - PDF Export Options panel and Grid Options panel allowing to configure export and grid options separately. Please experiment with these options and click the EXPORT TO PDF button to see how AG Grid can be exported to PDF in all of these configurations.

Code Samples

You can view or download the example in each of the major frameworks below:

  • JavaScript ( StackBlitz /  GitHub)
  • Angular ( StackBlitz /  GitHub)
  • React ( StackBlitz /  GitHub)
  • Vue ( StackBlitz /  GitHub)

Contents

  • Integrating the PDF export feature for AG Grid in your codebase
  • Configuring Column Exports
  • Exporting to PDF
  • Exporting with cell styles
  • Adding hyperlinks to exported cell values
  • Skipping columns in PDF export
  • Exporting selected rows only
  • Exported header and cell heights
  • Exported row background colors
  • Adding a Header Image
  • Adding a Footer with page index and count
  • Setting Page Orientation for export
  • Supported Grid Options
  • Column Grouping
  • Row Grouping
  • Filtering and Sorting
  • Extending the AG Grid-pdfMake integration

#pdf #angular #vuejs #react #javascript

Exporting AG Grid to PDF with pdfMake
11.15 GEEK