Skip to content

Commit 64de725

Browse files
committed
Expose current MigraDoc position.
1 parent 3de62ee commit 64de725

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

MigraDocCore.Rendering/MigraDoc.Rendering/FormattedDocument.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,19 @@ public PageInfo GetPageInfo(int page)
423423
return this.pageInfos[page];
424424
}
425425

426+
427+
/// <summary>
428+
/// Returns the absolute Y postion of the last item on last page in points.
429+
/// Must be called after rendering the document.
430+
/// </summary>
431+
/// <returns>double the Y Position.</returns>
432+
public double GetCurrentMigraDocPosition()
433+
{
434+
RenderInfo[] RenderInfos = GetRenderInfos(PageCount);
435+
RenderInfo r = RenderInfos[RenderInfos.Length - 1];
436+
return r.LayoutInfo.ContentArea.Y + r.LayoutInfo.ContentArea.Height;
437+
}
438+
426439
#region IAreaProvider Members
427440

428441
Area IAreaProvider.GetNextArea()

0 commit comments

Comments
 (0)