This sample shows how to draw cells manually using the formatItem callback function. Read More
Besides the simple cell customization, such as changing backround color, font, cell value etc the formatItem function allows user to draw cell manually.
The following steps are required:
To perform custom drawing the formatItem function argument provides the following properties:
In this sample the content of cells of "Country" column is drawn manually using PdfDocument API. The drawImage method is used to draw flag image at the specified position. The measureText method is used to get the size of the text to center it vertically. The drawText method is used to draw text at the specified position. The args.cancel property is setted to true to cancel default cell content drawing.