Is there a way I can know number of characters per line and number of lines that can fit into a page. My specific need is for page format 'Times New Roman' with A4 page format but I would like to know if there is a function in general that can help me with these details.
My requirement is like this - write data into a document and when the number of characters written is large enough to fit a page, I must give a page break and write rest of characters to a new page and so on. I can write a custom function for this but the term "formatted printing" associated with function printf, sprintf tempted me to think that PHP might already have a function that does this task and that a new custom function would be unnecessary.
One of the complexities with creating a custom function is that non Monospaced fonts such as 'Times New Roman' take different lengths for different characters