AODL.ExternalExporter.PDF.Document.ContentConverter.TableConverter.SetProperties C# (CSharp) Method

SetProperties() private method

Converts the specified table.
private SetProperties ( Table table, iTextSharp pdfTable, int maxCells ) : iTextSharp.text.pdf.PdfPTable
table AODL.Document.Content.Tables.Table The table.
pdfTable iTextSharp
maxCells int
return iTextSharp.text.pdf.PdfPTable
		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;
			}
		}