I'am using C# code to convert an Excel file to pdf file,
In this Excel file, I have a strikethrough cell, but in the PDF, this cell is not strikethrough.
This is my code C#.
Thank you.
------------------------------------------------------------------------------------------
newRelativeFilePath = "RI - JA-8336 (CM).xlsx";
System.Globalization.CultureInfo.CurrentCulture =
System.Globalization.CultureInfo.GetCultureInfo("fr-FR");
XlsIORendererSettings settings = new XlsIORendererSettings
{
EmbedFonts = true
};
using (ExcelEngine excelE = new ExcelEngine())
{
IApplication application = excelE.Excel;
application.DefaultVersion = ExcelVersion.Xlsx;
//Initialize XlsIO renderer.
XlsIORenderer renderer = new XlsIORenderer();
using (FileStream excelStream = new FileStream(newRelativeFilePath, FileMode.Open, FileAccess.Read))
{
IWorkbook wb = application.Workbooks.Open(excelStream);
ExcelTemplater.CalculateFormulaForPdf(wb);
//Convert Excel document with charts into PDF document
using (PdfDocument pdfDocument = renderer.ConvertToPDF(wb, settings))
{
using (Stream s = new FileStream(newRelativeFilePathPdf, FileMode.Create, FileAccess.ReadWrite))
{
if (data!.ContainsKey("annexes"))
{
AddAnnexes(JArray.Parse(data["annexes"].ToString()), pdfDocument);
}
pdfDocument.Save(s);
}
}
}
}
Attachment:
13012025_1e15f4ab.zip