What is the recommended way to draw a long string of text on two or more pages in a pdf document?
When you draw a string of text that is too long for a single page, the text is clipped at the end of the document. My initial idea was to calculate how much of the string can be drawn on the current page and then split the string in two substrings: (1) the part that can be drawn on the current page and (2) the part that is clipped. The next step would be to repeat this process until the entire string is drawn.
The question remains how to calculate how much of the string can be drawn on the current page. Am I overlooking something or is this a fairly tedious process that is error prone?
You could attempt to generate your PDF using the iOS print subsystem via UIMarkupTextPrintFormatter. I explain the technique here:
Is there any way to generate PDF file from a XML/HTML template in iOs
I haven’t tried to see what would happen re. pagination, but in theory it would do the right thing.