private iTextSharp.text.pdf.PdfPTable SetProperties(Table table, iTextSharp.text.pdf.PdfPTable pdfTable, int maxCells)
{
try
{
if (table.Style != null
&& table.Style is TableStyle
&& ((TableStyle)table.Style).TableProperties != null)
{
string strWidth = ((TableStyle)table.Style).TableProperties.Width;
if (strWidth != null)
{
double dWidth = AODL.Document.Helper.SizeConverter.GetDoubleFromAnOfficeSizeValue(strWidth);
if (dWidth != 0)
{
if (AODL.Document.Helper.SizeConverter.IsCm(strWidth))
{
dWidth = AODL.ExternalExporter.PDF.Document.Helper.MeasurementHelper.CmToPoints(dWidth);
pdfTable.LockedWidth = true;
pdfTable.TotalWidth = (float)dWidth;
}
else if (AODL.Document.Helper.SizeConverter.IsInch(strWidth))
{
dWidth = AODL.ExternalExporter.PDF.Document.Helper.MeasurementHelper.CmToPoints(dWidth);
pdfTable.LockedWidth = true;
pdfTable.TotalWidth = (float)dWidth;
}
}
}
else
{
// assume that's a 100% table
}
}
return pdfTable;
}
catch(Exception)
{
throw;
}
}