I have spent many hours trying to determine a formula to convert .NET pixels to an Excel column width using the OpenXML format. I am using EPPlus to generate xmls documents. I\'
The formula that i came up with to convert pixel width to Excel width is
private double PixelWidthToExcel(int pixels)
{
var tempWidth = pixels * 0.14099;
var correction = (tempWidth / 100) * -1.30;
return tempWidth - correction;
}
To me it always gives exact value conversion.
And the formula for height
private double PixelHeightToExcel(int pixels)
{
return pixels * 0.75;
}