How to remove header and footer when print in html/javascript ?


  • I would like to print my html page,

    I can set htmlPrintDocumentSource.enableHeaderFooter to false , to hide the header and footer,

    but they still hold the position , and will have white bar on the top and bottom .

    how can I remove the header and footer ?

    Monday, September 23, 2013 9:14 AM

All replies

  • Did you try setting the margins? For example, if you use the sample shown here: http://msdn.microsoft.com/en-us/library/windows/apps/hh831251.aspx and then modify the leftMargin and topMargin to have the values 0 for each, you should observe the difference. 

    Windows Store Developer Solutions #WSDevSol || Want more solutions? See our blog, http://aka.ms/t4vuvz

    Monday, September 23, 2013 6:59 PM
  • we have set the margins to 0

    var src = MSApp.getHtmlPrintDocumentSource(document);
    src.leftMargin = src.rightMargin = 0;
    src.topMargin = src.bottomMargin = 0;

    src.enableHeaderFooter = false;

    But it doesn't work , I guess that the header and footer were reserved.

    Tuesday, September 24, 2013 2:28 AM