Exemple #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);
        }
Exemple #2
0
        public PdfSize(PdfUnit unit, float width, float height)
        {
            if (unit == null)
            {
                throw new PdfException(StringConsts.ARGUMENT_ERROR + GetType().Name + ".ctor(unit==null)");
            }

            m_Unit = unit;
            Width  = width;
            Height = height;
        }