/// <summary> /// Begins a new line on the current region and sets up it's width. /// </summary> /// <param name="startparagraph">Set to true if this is the first line in a run or the first line in a new paragraph</param> /// <returns>The newly created and added line</returns> public PDFLayoutLine BeginNewLine() { this.AssertIsOpen(); this.AssertLastItemIsClosed(); PDFUnit width = this.GetAvailableWidth(); PDFLayoutLine line = new PDFLayoutLine(this, width, this.HAlignment, this.VAlignment, this.Contents.Count); line.SetOffset(line.OffsetX, this.UsedSize.Height); this.Contents.Add(line); return(line); }
/// <summary> /// Adds an existing line to this region, updating the items' parent in the process. /// And increasing the size of this region if the block is closed. /// </summary> /// <param name="item"></param> public virtual void AddExistingItem(PDFLayoutLine line) { if (null == line) { throw new ArgumentNullException("line"); } this._contents.Add(line); line.SetOffset(line.OffsetX, this.Height); line.SetParent(this); line.LineIndex = this.Contents.Count - 1; if (line.IsClosed) { this.AddToSize(line); } }