PdfSharp: dynamic generating document
<p>I got the following code for simply adding two textboxes-contents into a pdf-file:</p>

<pre><code>using System;
using System.Windows.Forms;
using PdfSharp.Pdf;
using MigraDoc.DocumentObjectModel;
using MigraDoc.Rendering;

namespace pdfDynamic
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //Creating the document
            Document document = new Document();
            Section section = document.AddSection();

            //Adding the first paragraph
            section.AddParagraph(richTextBox1.Text);

            //Adding the second paragraph
            section.AddParagraph(richTextBox2.Text);

            //Creating the document
            PdfDocumentRenderer renderer = new PdfDocumentRenderer(false, PdfFontEmbedding.Always);
            renderer.Document = document;
            renderer.RenderDocument();
            string pdfFilename = string.Format("Rekla-{0:dd.MM.yyyy_hh-mm-ss}.pdf", DateTime.Now);
            renderer.PdfDocument.Save(pdfFilename);

        }
    }
}
</code></pre>

<p>How can i detect if the second paragraph shows up from the first page to the second page? In this case i want to put the second paragraph on the second page only.</p>

<p>My english is not the best. Maybe my "<em>paint-skills</em>" are a better help to describe the problem:
<a href="https://i.stack.imgur.com/lgrgF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lgrgF.png" alt="current and desired situation"></a></p>