In a recent project we had to implement a mail-merge type feature where multiple html formatted documents (letters) were concatenated together for printing with a single print command. The challenge was to introduce page break before each document to avoid mixing-up of the individual letters. A quick and simple solution to this problem was using CSS page-break property after each letter content as highlighted in the code below:

 

<html>
	<head>
		<title>Letters</title>
	</head>
	<body>
		<div class="letter">
			<h1>Letter 1</h1>
			<div>
			 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum dictum vestibulum dui. Integer semper risus. Pellentesque eu neque. Sed luctus ante non ante. Sed sed ante eget purus rhoncus laoreet. Donec justo mauris, eleifend at, hendrerit id, dictum sed, dolor. Sed quis dui. Vestibulum id ligula. Morbi massa. Donec sit amet ipsum non risus sollicitudin accumsan. 
			</div>
		</div>
		<div style="page-break-after:always"></div>
		
		
		<div class="letter">
			<h1>Letter 2</h1>
			<div>
			 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum dictum vestibulum dui. Integer semper risus. Pellentesque eu neque. Sed luctus ante non ante. Sed sed ante eget purus rhoncus laoreet. Donec justo mauris, eleifend at, hendrerit id, dictum sed, dolor. Sed quis dui. Vestibulum id ligula. Morbi massa. Donec sit amet ipsum non risus sollicitudin accumsan. 
			</div>
		</div>
		<div style="page-break-after:always"></div>


		<div class="letter">
			<h1>Letter 3</h1>
			<div>
			 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum dictum vestibulum dui. Integer semper risus. Pellentesque eu neque. Sed luctus ante non ante. Sed sed ante eget purus rhoncus laoreet. Donec justo mauris, eleifend at, hendrerit id, dictum sed, dolor. Sed quis dui. Vestibulum id ligula. Morbi massa. Donec sit amet ipsum non risus sollicitudin accumsan. 
			</div>
		</div>
		<div style="page-break-after:always"></div>

	</body>

</html>