DocPublisher‎ > ‎3. How to‎ > ‎

How to print header on all printed pages


When printing HTML documents, previously defined print header appears only on top of the first printed page. Sometimes it might be necessary to print header on top of each printed page.


Here is the piece of JavaScript that should make it possible for you to print header on each printed page:


function jsAddDocTitle()

 var ifrm = window.frames["ifrmPrint"];

 if(!window.clientInformation || ifrm.document.readyState == "complete")

  var d = new Date();

  ifrm.document.title = "UNCONTROLLED " + " - PRINTED ON " + d.toString();



var ifrm = window.frames["ifrmPrint"];

if(ifrm != null)


  ifrm.attachEvent("onbeforeprint", jsAddDocTitle);



To make it work, this code snippet should be added to the active print header.

In this sample, "UNCONTROLLED - PRINTED ON <current_date>" prints on each page, but the JavaScript code can be customized to print something else.