The ExcelHeaderFooter.ScaleWithDoc property is missing in EPPlus 4.1.0.
It is implemented in EPPlus 3.
I have implemented this extension method in my code as a workaround:
public static void SetScaleWithDocToFalse(this ExcelWorksheet worksheet)
{
//worksheet.HeaderFooter.ScaleWithDoc = false; //NOTE: This is not implemented in EPPlus 4
var scaleWithDoc = worksheet.WorksheetXml.CreateAttribute("scaleWithDoc");
scaleWithDoc.Value = "0";
var headerFooterAttributes = worksheet.WorksheetXml.GetElementsByTagName("headerFooter")[0].Attributes;
headerFooterAttributes?.Append(scaleWithDoc);
}
It is implemented in EPPlus 3.
I have implemented this extension method in my code as a workaround:
public static void SetScaleWithDocToFalse(this ExcelWorksheet worksheet)
{
//worksheet.HeaderFooter.ScaleWithDoc = false; //NOTE: This is not implemented in EPPlus 4
var scaleWithDoc = worksheet.WorksheetXml.CreateAttribute("scaleWithDoc");
scaleWithDoc.Value = "0";
var headerFooterAttributes = worksheet.WorksheetXml.GetElementsByTagName("headerFooter")[0].Attributes;
headerFooterAttributes?.Append(scaleWithDoc);
}