Way to calculate number of "printing pages" from txt or htm

Hello Ruby friends!

Could anyone suggest a way to calculate how many pages a txt or htm
would take if I were to print them?

Any help will be much appreciated.

Regards,

Adam