static Table tableStyle(Appearance appearance, PageSize pageSize, Document pdoc) { float[] dim = appearance.getDimensions(); Table table = new Table(dim, true); table.UseAllAvailableWidth().SetDocument(pdoc); table.SetHeight(UnitValue.CreatePointValue(pageSize.GetHeight() - 28.333f)); for (int i = 0; i < appearance.getHeightRatio() + 1; i++) { for (int j = 0; j < appearance.getDimensions().Length; j++) { Cell cell = new Cell(); cell.SetHeight(table.GetHeight().GetValue() / appearance.getHeightRatio() - 4.666f); cellStyle(ref cell); table.AddCell(cell); } } return(table); }
/// <summary>Creates an array of UnitValue POINT objects with specified values.</summary> /// <param name="values">the values to be stored.</param> /// <returns> /// a new array of /// <see cref="POINT"/> /// /// <see cref="UnitValue"/> /// </returns> public static iText.Layout.Properties.UnitValue[] CreatePointArray(float[] values) { iText.Layout.Properties.UnitValue[] resultArray = new iText.Layout.Properties.UnitValue[values.Length]; for (int i = 0; i < values.Length; i++) { resultArray[i] = iText.Layout.Properties.UnitValue.CreatePointValue(values[i]); } return(resultArray); }
/// <summary>Creates an array of UnitValue PERCENT objects with equal values.</summary> /// <param name="size">of the resulted array.</param> /// <returns> /// a array of equal /// <see cref="PERCENT"/> /// /// <see cref="UnitValue"/>. /// </returns> public static iText.Layout.Properties.UnitValue[] CreatePercentArray(int size) { iText.Layout.Properties.UnitValue[] resultArray = new iText.Layout.Properties.UnitValue[size]; for (int i = 0; i < size; i++) { resultArray[i] = iText.Layout.Properties.UnitValue.CreatePercentValue(100f / size); } return(resultArray); }
public override bool Equals(Object obj) { if (GetType() != obj.GetType()) { return(false); } iText.Layout.Properties.UnitValue other = (iText.Layout.Properties.UnitValue)obj; return(JavaUtil.IntegerCompare(unitType, other.unitType) == 0 && JavaUtil.FloatCompare(value, other.value) == 0); }
/// <summary>Creates an array of UnitValue PERCENT objects with specified values.</summary> /// <param name="values">the values to be stored.</param> /// <returns> /// a new normalized (Σ=100%) array of /// <see cref="PERCENT"/> /// /// <see cref="UnitValue"/>. /// </returns> public static iText.Layout.Properties.UnitValue[] CreatePercentArray(float[] values) { iText.Layout.Properties.UnitValue[] resultArray = new iText.Layout.Properties.UnitValue[values.Length]; float sum = 0; foreach (float val in values) { sum += val; } for (int i = 0; i < values.Length; i++) { resultArray[i] = iText.Layout.Properties.UnitValue.CreatePercentValue(100 * values[i] / sum); } return(resultArray); }
/// <summary>Creates a copy of UnitValue object.</summary> /// <param name="unitValue"/> public UnitValue(iText.Layout.Properties.UnitValue unitValue) : this(unitValue.unitType, unitValue.value) { }