Background: I want to render text into a PDF, using the PDFDocument framework. This framework requires you to do pagination manually. The text will be multiple pages in length, so I need to split the text once it exceeds the page size
Problem: Each page is 540x720px** in size. So basically, I need to figure out how to split a long string at each point that it would fill a 540x720px TextView
.
Potential Hack: Overriding the onMeasure method of the TextView, and using a loop to continuously add text and re-measure until it exceeds 720px length
Is there a better solution to this?
**540x720px based on 8.5x11" paper, 0.5" margins, 72dpi