Hi,
I have 2 questions concerning the PDF export functionality:
1. Is it possible to somehow display a component only in the PDF but not in the browser?
I tried set the "isExporting" in the click handler that triggers PDF generation, but
the resulting PDF does not include the expected <h1> tag.
const [ isExporting, setIsExporting ] = useState(false);
const exportPdf = () => {
setIsExporting(true);
pdfExportRef.current.save(() => {
setIsExporting(false);
});
}
<PDFExport ...>
{isExporting && <h1>My title</h1>}
<table>..</table>
<Chart>..</Chart>
</PDFExport>
2. Is it possible add extra content into the PDF in case I generate a grid using the GridPDFExport component?
I am able to generate the file OK and the PDF output is as expected. However, I would like to add an extra title (<h1>) and paragraph (<p>) before the grid output (in the PDF). I am using GridPDFExport as I want generate all pages of a grid and remove filters, paging etc.
My code is based on this example: https://www.telerik.com/kendo-react-ui/components/grid/pdf-export/all-pages/
{grid}
<GridPDFExport ref={jobsPdfExportRef}
margin="1cm">
<h1>My title</h1>
<p>my description my descriptionmy descriptionmy descriptionmy descriptionmy description</p>
{grid}
</GridPDFExport>
Thank you
I have 2 questions concerning the PDF export functionality:
1. Is it possible to somehow display a component only in the PDF but not in the browser?
I tried set the "isExporting" in the click handler that triggers PDF generation, but
the resulting PDF does not include the expected <h1> tag.
const [ isExporting, setIsExporting ] = useState(false);
const exportPdf = () => {
setIsExporting(true);
pdfExportRef.current.save(() => {
setIsExporting(false);
});
}
<PDFExport ...>
{isExporting && <h1>My title</h1>}
<table>..</table>
<Chart>..</Chart>
</PDFExport>
2. Is it possible add extra content into the PDF in case I generate a grid using the GridPDFExport component?
I am able to generate the file OK and the PDF output is as expected. However, I would like to add an extra title (<h1>) and paragraph (<p>) before the grid output (in the PDF). I am using GridPDFExport as I want generate all pages of a grid and remove filters, paging etc.
My code is based on this example: https://www.telerik.com/kendo-react-ui/components/grid/pdf-export/all-pages/
{grid}
<GridPDFExport ref={jobsPdfExportRef}
margin="1cm">
<h1>My title</h1>
<p>my description my descriptionmy descriptionmy descriptionmy descriptionmy description</p>
{grid}
</GridPDFExport>
Thank you