SectionLink.cs 611 B

12345678910111213141516171819202122
  1. using QuestPDF.Drawing;
  2. using QuestPDF.Infrastructure;
  3. namespace QuestPDF.Elements
  4. {
  5. internal sealed class SectionLink : ContainerElement
  6. {
  7. public string SectionName { get; set; }
  8. internal override void Draw(Size availableSpace)
  9. {
  10. var targetSize = base.Measure(availableSpace);
  11. if (targetSize.Type == SpacePlanType.Wrap)
  12. return;
  13. var targetName = PageContext.GetDocumentLocationName(SectionName);
  14. Canvas.DrawSectionLink(targetName, targetSize);
  15. base.Draw(availableSpace);
  16. }
  17. }
  18. }