As part of the print class, I want to be able to print long lines on multiple pages, but I don’t know how to calculate the height of the whole line that I will determine by first counting the number of lines in my line. I know that I can count the number of line breaks, but I also use word-wrap, so line breaks will be added whenever the line goes across the width of the page. Therefore, I believe that I can count the number of line breaks and find out the width of each line and find out if there is a need for line breaks for words for each line, but this seems too complicated a problem for something. I think it can be made easier.
e.Graphics.DrawString(multiPageString, new Font("Courier New", 12), Brushes.Black, new RectangleF(0, 0, 810, pageHeight));
If you have any tips please let me know thanks!
source
share