. . .
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>
);
}
}
|
Looks like Help documentation link has been broken. Please could you make it available again? Actually I'd like to see how you applied the base64 string to pdfTrupetypeFont.
Thanks.
Hi Emrah,
Greetings from Syncfusion support,
We have revamped our documentation site which was rolled out recently. You can refer the below link for the documentation mentioned in the previous update.
Documentation: https://ej2.syncfusion.com/react/documentation/grid/pdf-export/pdf-export-options/#add-custom-font
Please get back to us for further details.
Regards,
Joseph I