--- title: Getting Started description: 'Get an overview of the features the KendoReact PDF Generator delivers and use the component in React projects.' components: ['pdfprocessing'] slug: getstarted_pdf position: 1 --- # Getting Started with the KendoReact PDF Generator This guide provides essential information about using the KendoReact PDF Generator package. You will learn how to install the PDF Generator package, add a PDF Generator component to your project, style the component, and activate your license.
After completing this guide, you will be able to reproduce the following example. {% meta height:620 %} {% embed_file get-started/func/app.tsx preview %} {% embed_file get-started/func/main.tsx %} {% embed_file get-started/func/products.json %} {% endmeta %} ## Before You Begin To follow the steps in this guide, you need to have a React project set up. If you don't have one, you can create a new React application using Vite by running the following command in your terminal: ```sh npm create vite@latest my-app -- --template react ``` This guide requires that you have **basic knowledge of React and TypeScript**, and that you have already created [**a blank React project**](slug://getting_started). > tip You can speed up the development of your KendoReact application with the [Kendo UI Template Wizard for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=KendoUI.kendotemplatewizard). ## Install the Component To install the PDF Generator package, run the following command in the root folder of your React project: ```sh npm i @progress/kendo-react-pdf ``` This guide requires that you have **basic knowledge of React and TypeScript**, and that you have already created [**a blank React project**](slug://getting_started). > tip You can speed up the development of your KendoReact application with the [Kendo UI Template Wizard for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=KendoUI.kendotemplatewizard). ## Install the Component To install the PDF Generator package, run the following command in the root folder of your React project: ```sh npm i @progress/kendo-react-pdf ``` ## Importing the Component After installing the package, import the PDF Generator component in the React App. In the `src/App.js` file of your React project, import the `PDFExport` and `savePDF` components from the PDF package. The `PDFExport` and `savePDF` provide the export and save functionality. ```jsx-no-run // ES2015 module syntax import { PDFExport, savePDF } from '@progress/kendo-react-pdf'; ``` ```jsx-no-run // CommonJS format const { PDFExport, savePDF } = require('@progress/kendo-react-pdf'); ``` ## Using the Component 1. Create a ref to the component that will later be used for the export ```jsx const pdfExportComponent = React.useRef(null); ``` 2. Create two functions that will handle the export, the first one will export with a method, and the second one will handle the component export. ```jsx const exportPDFWithMethod = () => { let element = document.querySelector('.k-grid') || document.body; savePDF(element, { paperSize: 'A4' }); }; const exportPDFWithComponent = () => { if (pdfExportComponent.current) { pdfExportComponent.current.save(); } }; ``` 3. Wrap the PDFExport component around the component that you wish to export. ```jsx