If your content is correctly formatted paging should happen automatically. Using page-break-after: always; also works. There may be something blocking the content from paging, either due to some structural problems, a style applied, or even a bug. But we can't tell without seeing the actual HTML content.
You should first check the value of your $html variable to make sure it contains what you expect. For example, you're using a greedy regex selector (.*) instead of the less greedy (.*?) and maybe you're losing content.