var exportProperties = {
header: {
fromTop: 0,
height: 130,
contents: [
{
type: 'Image',
src: image,
position: { x: 435, y: 10 },
size: { height: 100, width: 250 },
}
]
}
} |
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).AllowPdfExport().ToolbarClick("toolbarClick")
.Columns(col =>
{
...
}).Toolbar(new List<string>() { "PdfExport" }).Render()
<script type="text/javascript">
function toolbarClick(args) {
var gridObj = document.getElementById("Grid").ej2_instances[0];
if (args['item'].id === 'Grid_pdfexport') {
var pdfExportProperties = {
header: {
fromTop: 0,
height: 130,
contents: [
{
type: 'Image',
src: image //give image as Base64 string
position: { x: 435, y: 10 },
size: { height: 100, width: 250 },
}
]
}
};
gridObj.pdfExport(pdfExportProperties);
}
}
</script> |