Fitting Content to Paper SizePremium
The saveGridPDF
method from the @progress/kendo-react-pdf
package lets you scale the KendoReact Data Grid content when you export it to PDF.
By default, the Grid size on screen sets the paper size of your PDF. You can pick a specific paper size for the whole document instead. This makes the content scale to fit your chosen paper size. You can also change the scale factor yourself—for example, to add space for other items on the page.
- In your Grid definition, set the
pdf
prop totrue
to enable exporting to PDF. - Set the paper size with the
saveGridPDF
method. The method accepts three parameters: the Grid element reference, a configuration object with thepaperSize
andscale
properties, and an optional callback function. - Use the
onPdfExport
event handler of the Grid to call thesaveGridPDF
method when the export is triggered.
This example shows how the Grid can fit its content to a predefined A4
paper size:
Change Theme
Theme
Loading ...