When the length of the text is longer than the width of the page you need to separate the text into two or more parts.
For each part, the text length must be smaller than the page width.
You can get the position of the last empty character with Index = Text.LastIndexOf(" ")
Then with Text.Substring(0, Index) you can get the first part.
Measure its length and if it's smaller than the page width write on the first line Text.Substring(0, Index)
And on the second line Text.Substring(Index + 1, Text.Length)
If the length of Text.Substring(0, Index) is still wider than the page.
Get the index of the next empty character with Index = Text.LastIndexOf2(" ", Index - 1).
And so on.