How do we remove the top and left margins when printing an iframe?

  css, javascript, pdf, telerik
ReportViewer.prototype.PrintReport = function () {
    var targetFrame = document.getElementById('iframeid').contentWindow;
    targetFrame.focus();
    targetFrame.print();
    return false;
};

So I was using this hack to be able to print a document generated by Telerik Report. I am using ASP.NET Web Forms Report Viewer, which is deprecated. This is why I am using a hack to get the thing printed. However, the only issue is that the margins are incorrect when I print it using the Telerik button. When I print the document when I print after opening the document with Adobe the margins are correct (no margin gets added), but when I use the Telerik button it does not work. How do I fix the margins?

Source: Ask Javascript Questions

LEAVE A COMMENT