コード例 #1
0
ファイル: PdfSize.cs プロジェクト: sergey-msu/nfx
    /// <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
        /// <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);
        }
コード例 #3
0
ファイル: PdfPage.cs プロジェクト: itadapter/nfx
 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>();
 }
コード例 #4
0
ファイル: PdfSize.cs プロジェクト: sergey-msu/nfx
    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;
    }
コード例 #5
0
ファイル: PdfSize.cs プロジェクト: vlapchenko/nfx
    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;
    }
コード例 #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;
        }
コード例 #7
0
ファイル: PdfDocument.cs プロジェクト: itadapter/nfx
 /// <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);
 }