Esempio n. 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;
    }
Esempio n. 2
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);
        }
Esempio n. 3
0
 internal PdfPage(PdfPageTree parent, PdfSize size)
 {
     m_Size = size;
       m_Unit = m_Size.Unit;
       m_Parent = parent;
       m_Fonts = new List<PdfFont>();
       m_Elements = new List<PdfElement>();
 }
Esempio n. 4
0
    public PdfSize(PdfUnit unit, float width, float height)
    {
      if (unit == null)
        throw new ArgumentException("unit should not be null");

      m_Unit = unit;
      Width = width;
      Height = height;
    }
Esempio n. 5
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;
    }
Esempio n. 6
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;
        }
Esempio n. 7
0
 /// <summary>
 /// Adds new page to document
 /// </summary>
 /// <returns>Page</returns>
 public PdfPage AddPage(PdfUnit unit)
 {
     unit = unit ?? Unit ?? PdfUnit.Default;
       var size = PageSize != null ? PageSize.ChangeUnits(unit) : PdfPageSize.Default(unit);
       return AddPage(size);
 }