/// <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; }
/// <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); }
/// <summary> /// Creates new page and adds it to the page tree /// </summary> /// <returns></returns> public PdfPage CreatePage(PdfSize size) { var page = new PdfPage(this, size); m_Pages.Add(page); return page; }
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); }
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>(); }
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))); }
public PdfDocument() { m_Fonts = new List<PdfFont>(); m_Meta = new PdfMeta(); m_Info = new PdfInfo(); m_OutLines = new PdfOutlines(); m_Root = new PdfRoot(); m_PageTree = new PdfPageTree(); m_Trailer = new PdfTrailer(); m_ObjectRepository = new ObjectRepository(); m_ResourceRepository = new ResourceRepository(); m_Root.Info = m_Info; m_Root.Outlines = m_OutLines; m_Root.PageTree = m_PageTree; m_Trailer.Root = m_Root; m_PageSize = PdfPageSize.Default(); }
/// <summary> /// Adds new page to document /// </summary> /// <returns>Page</returns> public PdfPage AddPage(PdfSize size = null) { size = size ?? PageSize ?? PdfPageSize.Default(); return m_PageTree.CreatePage(size); }