예제 #1
0
        /// <summary>
        /// Change unit of the size and recalculate height and width
        /// </summary>
        /// <param name="unit">New unit</param>
        public PdfSize ChangeUnits(PdfUnit unit)
        {
            var ratio  = Unit.Points / unit.Points;
            var result = new PdfSize(unit, Height * ratio, Width * ratio);

            return(result);
        }
예제 #2
0
 public bool Equals(PdfSize other)
 {
     if (other == null)
     {
         return(false);
     }
     return(Math.Abs(this.Height - other.Height) < double.Epsilon &&
            Math.Abs(this.Width - other.Width) < double.Epsilon &&
            ((this.Unit == null) ? (other.Unit == null) : this.Unit.Equals(other.Unit)));
 }