@page media="print" in vf page code example
Example: how to get header in all the pages in visualforce page
<apex:page sidebar="false" showHeader="false" applyHtmlTag="false"
standardStylesheets="false" readonly="true"
renderAs="pdf">
<html>
<head>
<style type="text/css">
@page {
size: A5 landscape;
@bottom-right {
content: "https://stackoverflow.com\A" counter(page) " of " counter(pages);
white-space: pre-line;
}
}
</style>
</head>
</html>
</apex:page>