Divide the html page into several pages automatically like MS WORD

Is ther any way to divide a html context contained div, p and table tages into separated pages in separated div tages (or at least just separated) for a defined height? (like ms word but online)

I want to create an html template for formal letters that might have multiple pages.
Expected a solution by using php or javascript or just html and css.

I use a persian font not english !

By the way, is there any other ways for creating those types of templates? (not using third party websites)… If yes, please give an example.

Note that I want to create pdf and image and ms word doc from that html too!

Thanks 🙂