Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
148193 | Oct 9,2019 04:49 PM UTC | Oct 10,2019 06:51 AM UTC | React - EJ 2 | 1 |
![]() |
Tags: Grid |
. . .
import { PdfTrueTypeFont } from '@syncfusion/ej2-pdf-export';
import { adventProFont } from './font'; // adventProFont is a base 64 of ttf
export default class App extends React.Component<{}, {}> {
. . .
public toolbarClick = (args: ClickEventArgs) => {
const pdfExportProperties: PdfExportProperties = {
theme: {
caption: { font: new PdfTrueTypeFont(adventProFont, 10) },
header: {font: new PdfTrueTypeFont(adventProFont, 12) },
record: { font: new PdfTrueTypeFont(adventProFont, 9) }
}
};
if (this.grid) {
this.grid.pdfExport(pdfExportProperties);
}
}
public render() {
this.toolbarClick = this.toolbarClick.bind(this);
return (
<div>
<GridComponent id='grid' dataSource={data.slice(0, 5)} toolbar={this.toolbar}
allowPdfExport={true} toolbarClick={this.toolbarClick}
ref={g => this.grid = g}>
<ColumnsDirective>
. . .
</ColumnsDirective>
<Inject services={[Toolbar, PdfExport]}/>
</GridComponent>
</div>
);
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.