Hi,
In my program I have a very long string, that contains text. It can fill up 2 or more pages of a PDF file (I don't know how many pages).
I make a new page in my code like this:
Code:
page = document.AddPage();
gfx = XGraphics.FromPdfPage(page);
Then I write the long string to the page like this ("text" is the string that must be written):
Code:
XTextFormatter tf = new XTextFormatter(gfx);
tf.Alignment = XParagraphAlignment.Justify;
tf.DrawString(text, font, XBrushes.Black, new XRect(0 + 10, 0 + 10, page.Width - 20, page.Height - 20), XStringFormats.TopLeft);
The string is too long for 1 page so it doesn't fit. It's written until the current page is filled (part of the string is not written, because it's too long for the page)
Is there a way PDFsharp can add more pages automatically when a string is too long for 1 page?
Or how do I solve this problem?
Jessica