Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
To get warnings for font substitution when rendering Excel files to PDF, implement the IWarningCallback interface and set the PdfSaveOptions.WarningCallback property with your implemented interface.
The screenshot below shows a source Excel file that we will use in the following code. It has some text in cells A6 and A7 in fonts that are not rendered correctly by Microsoft Excel.
| Not all fonts are rendered correctly |
|---|
![]() |
Aspose.Cells will substitute the fonts in cells A6 and A7 with suitable fonts as shown below.
| Substituted fonts |
|---|
![]() |
You can download the source Excel file and the output PDF from the following links
The following code implements the IWarningCallback and sets the PdfSaveOptions.WarningCallback property with the implemented interface. Now, whenever a font is substituted in any cell, Aspose.Cells will fire a warning inside the WarningCallback.Warning() method.
After converting the source Excel file to PDF, the warnings are output to the debug console like this:
WARNING INFO: Font substitution: Font [ Athene Logos; Regular ] has been substituted in Cell [ A6 ] in Sheet [ Sheet1 ].
WARNING INFO: Font substitution: Font [ B Traffic; Regular ] has been substituted in Cell [ A7 ] in Sheet [ Sheet1 ].
Workbook.CalculateFormula method just before rendering the spreadsheet to PDF format. Doing so will ensure that the formula‑dependent values are recalculated, and the correct values are rendered in the PDF.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.